From f8b44c19a1eb1d5deae064b3170e428b74f95b9b Mon Sep 17 00:00:00 2001 From: HWT Date: Sun, 11 Aug 2024 19:19:20 +0800 Subject: [PATCH 1/2] Update FanEntityFeature.TURN_OFF / TURN_ON To comply https://developers.home-assistant.io/blog/2024/07/19/fan-fanentityfeatures-turn-on_off/ HA Core 2024.8 --- custom_components/smartir/fan.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom_components/smartir/fan.py b/custom_components/smartir/fan.py index 14b99ae1..6e2c2e5b 100644 --- a/custom_components/smartir/fan.py +++ b/custom_components/smartir/fan.py @@ -92,7 +92,11 @@ def __init__(self, hass, config, device_data): self._speed = None self._oscillating = None self._on_by_remote = False - self._support_flags = FanEntityFeature.SET_SPEED + self._support_flags = ( + FanEntityFeature.SET_SPEED + | FanEntityFeature.TURN_ON + | FanEntityFeature.TURN_OFF + ) self._power_sensor_check_expect = None self._power_sensor_check_cancel = None From f5a63838a31db03d5a751094b00e97fb1af26994 Mon Sep 17 00:00:00 2001 From: HWT Date: Tue, 13 Aug 2024 09:36:36 +0800 Subject: [PATCH 2/2] Updated feature flags with backwards compatibility --- custom_components/smartir/fan.py | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_components/smartir/fan.py b/custom_components/smartir/fan.py index 6e2c2e5b..be4b7b36 100644 --- a/custom_components/smartir/fan.py +++ b/custom_components/smartir/fan.py @@ -76,6 +76,7 @@ async def async_setup_platform( class SmartIRFan(FanEntity, RestoreEntity): _attr_should_poll = False + _enable_turn_on_off_backwards_compatibility = False def __init__(self, hass, config, device_data): self.hass = hass