Skip to content

Commit 9d85893

Browse files
cdnninjajoostlek
authored andcommitted
Fix VeSync zero fan speed handling (home-assistant#153493)
Co-authored-by: Joostlek <[email protected]>
1 parent 9e8a702 commit 9d85893

File tree

3 files changed

+2
-109
lines changed

3 files changed

+2
-109
lines changed

homeassistant/components/vesync/fan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ def percentage(self) -> int | None:
100100
"""Return the currently set speed."""
101101

102102
current_level = self.device.state.fan_level
103-
104103
if self.device.state.mode == VS_FAN_MODE_MANUAL and current_level is not None:
104+
if current_level == 0:
105+
return 0
105106
return ordered_list_item_to_percentage(
106107
self.device.fan_levels, current_level
107108
)

tests/components/vesync/common.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,6 @@ def mock_multiple_device_responses(
147147
)
148148

149149

150-
def mock_air_purifier_400s_update_response(aioclient_mock: AiohttpClientMocker) -> None:
151-
"""Build a response for the Helpers.call_api method for air_purifier_400s with updated data."""
152-
153-
device_name = "Air Purifier 400s"
154-
for fixture in DEVICE_FIXTURES[device_name]:
155-
getattr(aioclient_mock, fixture[0])(
156-
f"https://smartapi.vesync.com{fixture[1]}",
157-
json=load_json_object_fixture("air-purifier-detail-updated.json", DOMAIN),
158-
)
159-
160-
161150
def mock_device_response(
162151
aioclient_mock: AiohttpClientMocker, device_name: str, override: Any
163152
) -> None:

tests/components/vesync/test_platform.py

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)