diff --git a/custom_components/jcihitachi_tw/fan.py b/custom_components/jcihitachi_tw/fan.py index 540c99e..1ad79a9 100644 --- a/custom_components/jcihitachi_tw/fan.py +++ b/custom_components/jcihitachi_tw/fan.py @@ -220,6 +220,9 @@ def unique_id(self): def calculate_supported_features(self): support_flags = 0 + if self._thing.support_code.Switch != "unsupported": + support_flags |= FanEntityFeature.TURN_ON + support_flags |= FanEntityFeature.TURN_OFF if self._thing.support_code.FanSpeed != "unsupported": support_flags |= FanEntityFeature.SET_SPEED if self._thing.support_code.BreathMode != "unsupported": @@ -277,4 +280,4 @@ def turn_off(self, **kwargs): """Turn the device off.""" _LOGGER.debug(f"Turn {self.name} off") self.put_queue(status_name="Switch", status_str_value="off") - self.update() \ No newline at end of file + self.update()