Skip to content

Commit

Permalink
Tweak Hydrojet behaviours
Browse files Browse the repository at this point in the history
  • Loading branch information
cdpuk committed Jan 8, 2024
1 parent e435bd1 commit e70c8fe
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions custom_components/bestway/bestway/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,10 @@ async def hydrojet_spa_set_filter(self, device_id: str, filtering: bool) -> None
raise BestwayException(f"Device '{device_id}' is not recognised")

_LOGGER.debug("Setting filter mode to %s", "ON" if filtering else "OFF")
await self._do_control_post(device_id, filter=1 if filtering else 0)
api_value = 2 if filtering else 0
await self._do_control_post(device_id, filter=2 if filtering else 0)
cached_state.timestamp = int(time())
cached_state.attrs["filter"] = filtering
cached_state.attrs["filter"] = api_value
if filtering:
cached_state.attrs["power"] = True
else:
Expand All @@ -340,12 +341,13 @@ async def hydrojet_spa_set_heat(self, device_id: str, heat: bool) -> None:
raise BestwayException(f"Device '{device_id}' is not recognised")

_LOGGER.debug("Setting heater mode to %s", "ON" if heat else "OFF")
await self._do_control_post(device_id, heat=HydrojetHeat.ON if heat else 0)
api_value = HydrojetHeat.ON if heat else 0
await self._do_control_post(device_id, heat=api_value)
cached_state.timestamp = int(time())
cached_state.attrs["heat"] = heat
cached_state.attrs["heat"] = api_value
if heat:
cached_state.attrs["power"] = True
cached_state.attrs["filter"] = HydrojetHeat.ON
cached_state.attrs["filter"] = True

async def hydrojet_spa_set_target_temp(
self, device_id: str, target_temp: int
Expand Down

0 comments on commit e70c8fe

Please sign in to comment.