From 0ab58798ccb36e7c56ac992dd3e41d37f32c20f7 Mon Sep 17 00:00:00 2001 From: Sanjoy Ghosh Date: Fri, 30 Aug 2024 20:10:21 +0530 Subject: [PATCH] Preset mode fix --- custom_components/dirigera_platform/fan.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/custom_components/dirigera_platform/fan.py b/custom_components/dirigera_platform/fan.py index f5984ce..2b99d6e 100644 --- a/custom_components/dirigera_platform/fan.py +++ b/custom_components/dirigera_platform/fan.py @@ -197,10 +197,6 @@ async def async_set_fan_mode(self, preset_mode: FanModeEnum) -> None: logger.debug("set_fan_mode : {}".format(preset_mode.value)) await self._hass.async_add_executor_job(self._json_data.set_fan_mode, preset_mode) - #def set_fan_mode(self, preset_mode: FanModeEnum) -> None: - # logger.debug("set_fan_mode : {}".format(preset_mode.value)) - # self._hass.async_add_executor_job(self._json_data.set_fan_mode, preset_mode) - async def async_set_preset_mode(self, preset_mode: str): logger.debug("set_preset_mode : {}".format(preset_mode)) mode_to_set = None @@ -221,8 +217,9 @@ async def async_set_preset_mode(self, preset_mode: str): return logger.debug("set_preset_mode equated to : {}".format(mode_to_set.value)) - await self._hass.async_add_executor_job(self.async_set_fan_mode, mode_to_set) - + #await self._hass.async_add_executor_job(self.async_set_fan_mode, mode_to_set) + await self._hass.async_add_executor_job(self._json_data.set_fan_mode, mode_to_set) + async def async_turn_on(self, percentage=None, preset_mode=None) -> None: logger.debug( "Airpurifier call to turn_on with percentage: {}, preset_mode: {}".format(