Skip to content

Commit

Permalink
fix: Power on AirLeaf before changing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrivard committed Jan 31, 2023
1 parent 598edd0 commit 86704c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions innova_controls/airleaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ async def night_mode_off(self) -> bool:
return False

async def set_heating(self) -> bool:
return await super()._set_mode(self.Modes.HEATING)
if self.power or await self.power_on():
return await self._set_mode(self.Modes.HEATING)
return False

async def set_cooling(self) -> bool:
return await super()._set_mode(self.Modes.COOLING)
if self.power or await self.power_on():
return await self._set_mode(self.Modes.COOLING)
return False

async def set_auto(self) -> bool:
pass
Expand Down
10 changes: 5 additions & 5 deletions innova_controls/twopointzero.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,16 @@ async def night_mode_off(self) -> bool:
return False

async def set_heating(self) -> bool:
return await super()._set_mode(self.Modes.HEATING)
return await self._set_mode(self.Modes.HEATING)

async def set_cooling(self) -> bool:
return await super()._set_mode(self.Modes.COOLING)
return await self._set_mode(self.Modes.COOLING)

async def set_dehumidifying(self) -> bool:
return await super()._set_mode(self.Modes.DEHUMIDIFICATION)
return await self._set_mode(self.Modes.DEHUMIDIFICATION)

async def set_fan_only(self) -> bool:
return await super()._set_mode(self.Modes.FAN_ONLY)
return await self._set_mode(self.Modes.FAN_ONLY)

async def set_auto(self) -> bool:
return await super()._set_mode(self.Modes.AUTO)
return await self._set_mode(self.Modes.AUTO)

0 comments on commit 86704c3

Please sign in to comment.