Skip to content

Commit

Permalink
Update the status immediatly
Browse files Browse the repository at this point in the history
  • Loading branch information
rossdargan committed Dec 1, 2020
1 parent 1556adc commit 31a1b8d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions layz_spa/spa.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,41 +64,47 @@ async def set_power(self, power):
"""
if power:
await self.api.send_command("turn_on")
power=True
else:
await self.api.send_command("turn_off")
power=False

async def set_filter_power(self, power):
"""
Turn the filter on or off
"""
if power:
await self.api.send_command("turn_filter_on")
filter_power=True
else:
await self.api.send_command("turn_filter_off")
filter_power=False

async def set_heat_power(self, power):
"""
Turn the heater on or off
"""
if power:
# The filter MUST be turned on if the heater is to be turned on
if(not self.heat_power):
await self.api.send_command("turn_filter_on")
await self.api.send_command("turn_heat_on")
heat_power=True
else:
await self.api.send_command("turn_heat_off")
heat_power=False

async def set_wave_power(self, power):
"""
Turn the bubbles on and off
"""
if power:
await self.api.send_command("turn_wave_on")
wave_power=True
else:
await self.api.send_command("turn_wave_off")
wave_power=False

async def set_target_temperature(self, temperature):
"""
Set the target temperature for the spa
"""
await self.api.send_command("temp_set", {"temperature": temperature})
await self.api.send_command("temp_set", {"temperature": temperature})
target=temperature

0 comments on commit 31a1b8d

Please sign in to comment.