Skip to content

Commit

Permalink
Preset mode fix
Browse files Browse the repository at this point in the history
  • Loading branch information
c503ghosh committed Aug 30, 2024
1 parent 55abf4b commit 0ab5879
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions custom_components/dirigera_platform/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down

0 comments on commit 0ab5879

Please sign in to comment.