Skip to content

Commit

Permalink
Enable the PRESET_MODE FanEntityFeature for VeSync air purifiers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckyCrayfish authored Aug 3, 2023
1 parent 4c395c0 commit 6f8d666
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/vesync/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ def _setup_entities(devices, async_add_entities):
class VeSyncFanHA(VeSyncDevice, FanEntity):
"""Representation of a VeSync fan."""

_attr_supported_features = FanEntityFeature.SET_SPEED
_attr_supported_features = FanEntityFeature.SET_SPEED | FanEntityFeature.PRESET_MODE
_attr_name = None

def __init__(self, fan):
def __init__(self, fan) -> None:
"""Initialize the VeSync fan device."""
super().__init__(fan)
self.smartfan = fan
Expand Down
2 changes: 1 addition & 1 deletion tests/components/vesync/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
'auto',
'sleep',
]),
'supported_features': 1,
'supported_features': 9,
}),
'entity_id': 'fan.fan',
'last_changed': str,
Expand Down
16 changes: 8 additions & 8 deletions tests/components/vesync/snapshots/test_fan.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
'original_icon': None,
'original_name': None,
'platform': 'vesync',
'supported_features': <FanEntityFeature: 1>,
'supported_features': <FanEntityFeature: 9>,
'translation_key': None,
'unique_id': 'air-purifier',
'unit_of_measurement': None,
Expand All @@ -73,7 +73,7 @@
'auto',
'sleep',
]),
'supported_features': <FanEntityFeature: 1>,
'supported_features': <FanEntityFeature: 9>,
}),
'context': <ANY>,
'entity_id': 'fan.air_purifier_131s',
Expand Down Expand Up @@ -140,7 +140,7 @@
'original_icon': None,
'original_name': None,
'platform': 'vesync',
'supported_features': <FanEntityFeature: 1>,
'supported_features': <FanEntityFeature: 9>,
'translation_key': None,
'unique_id': 'asd_sdfKIHG7IJHGwJGJ7GJ_ag5h3G55',
'unit_of_measurement': None,
Expand All @@ -161,7 +161,7 @@
'sleep',
]),
'screen_status': True,
'supported_features': <FanEntityFeature: 1>,
'supported_features': <FanEntityFeature: 9>,
}),
'context': <ANY>,
'entity_id': 'fan.air_purifier_200s',
Expand Down Expand Up @@ -229,7 +229,7 @@
'original_icon': None,
'original_name': None,
'platform': 'vesync',
'supported_features': <FanEntityFeature: 1>,
'supported_features': <FanEntityFeature: 9>,
'translation_key': None,
'unique_id': '400s-purifier',
'unit_of_measurement': None,
Expand All @@ -251,7 +251,7 @@
'sleep',
]),
'screen_status': True,
'supported_features': <FanEntityFeature: 1>,
'supported_features': <FanEntityFeature: 9>,
}),
'context': <ANY>,
'entity_id': 'fan.air_purifier_400s',
Expand Down Expand Up @@ -319,7 +319,7 @@
'original_icon': None,
'original_name': None,
'platform': 'vesync',
'supported_features': <FanEntityFeature: 1>,
'supported_features': <FanEntityFeature: 9>,
'translation_key': None,
'unique_id': '600s-purifier',
'unit_of_measurement': None,
Expand All @@ -341,7 +341,7 @@
'sleep',
]),
'screen_status': True,
'supported_features': <FanEntityFeature: 1>,
'supported_features': <FanEntityFeature: 9>,
}),
'context': <ANY>,
'entity_id': 'fan.air_purifier_600s',
Expand Down

0 comments on commit 6f8d666

Please sign in to comment.