From 6f8d666b57a629b3d07a30cfb9cd3ee891f275c1 Mon Sep 17 00:00:00 2001 From: Nick Iacullo Date: Thu, 3 Aug 2023 09:30:56 -0700 Subject: [PATCH] Enable the `PRESET_MODE` `FanEntityFeature` for VeSync air purifiers (#97657) --- homeassistant/components/vesync/fan.py | 4 ++-- .../vesync/snapshots/test_diagnostics.ambr | 2 +- tests/components/vesync/snapshots/test_fan.ambr | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/vesync/fan.py b/homeassistant/components/vesync/fan.py index a3bf027c28f..e5347b204e6 100644 --- a/homeassistant/components/vesync/fan.py +++ b/homeassistant/components/vesync/fan.py @@ -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 diff --git a/tests/components/vesync/snapshots/test_diagnostics.ambr b/tests/components/vesync/snapshots/test_diagnostics.ambr index c463db179eb..10dfdd2ba14 100644 --- a/tests/components/vesync/snapshots/test_diagnostics.ambr +++ b/tests/components/vesync/snapshots/test_diagnostics.ambr @@ -200,7 +200,7 @@ 'auto', 'sleep', ]), - 'supported_features': 1, + 'supported_features': 9, }), 'entity_id': 'fan.fan', 'last_changed': str, diff --git a/tests/components/vesync/snapshots/test_fan.ambr b/tests/components/vesync/snapshots/test_fan.ambr index 428f066e6cc..fa1a7a7b332 100644 --- a/tests/components/vesync/snapshots/test_fan.ambr +++ b/tests/components/vesync/snapshots/test_fan.ambr @@ -58,7 +58,7 @@ 'original_icon': None, 'original_name': None, 'platform': 'vesync', - 'supported_features': , + 'supported_features': , 'translation_key': None, 'unique_id': 'air-purifier', 'unit_of_measurement': None, @@ -73,7 +73,7 @@ 'auto', 'sleep', ]), - 'supported_features': , + 'supported_features': , }), 'context': , 'entity_id': 'fan.air_purifier_131s', @@ -140,7 +140,7 @@ 'original_icon': None, 'original_name': None, 'platform': 'vesync', - 'supported_features': , + 'supported_features': , 'translation_key': None, 'unique_id': 'asd_sdfKIHG7IJHGwJGJ7GJ_ag5h3G55', 'unit_of_measurement': None, @@ -161,7 +161,7 @@ 'sleep', ]), 'screen_status': True, - 'supported_features': , + 'supported_features': , }), 'context': , 'entity_id': 'fan.air_purifier_200s', @@ -229,7 +229,7 @@ 'original_icon': None, 'original_name': None, 'platform': 'vesync', - 'supported_features': , + 'supported_features': , 'translation_key': None, 'unique_id': '400s-purifier', 'unit_of_measurement': None, @@ -251,7 +251,7 @@ 'sleep', ]), 'screen_status': True, - 'supported_features': , + 'supported_features': , }), 'context': , 'entity_id': 'fan.air_purifier_400s', @@ -319,7 +319,7 @@ 'original_icon': None, 'original_name': None, 'platform': 'vesync', - 'supported_features': , + 'supported_features': , 'translation_key': None, 'unique_id': '600s-purifier', 'unit_of_measurement': None, @@ -341,7 +341,7 @@ 'sleep', ]), 'screen_status': True, - 'supported_features': , + 'supported_features': , }), 'context': , 'entity_id': 'fan.air_purifier_600s',