Add support to write the 'cooling temperature'

This commit is contained in:
Roberto Cosenza 2021-06-19 22:24:09 +01:00
parent ee252edc18
commit 43dbc27c0f
2 changed files with 25 additions and 0 deletions

View File

@ -467,6 +467,27 @@ class NeoHub:
result = await self._send(message, reply)
return result
async def set_cool_temp(self, temperature: int, devices: [NeoStat]):
"""
Sets the thermostat's cooling temperature i.e. the temperature that will
trigger the thermostat if exceeded. Note that this is only supported on
the HC (Heating/Cooling) thermostats.
The temperature will be reset once next comfort level is reached
"""
try:
names = [x.name for x in devices]
except (TypeError, AttributeError):
raise NeoHubUsageError('devices must be a list of NeoStat objects')
message = {"SET_COOL_TEMP": [temperature, names]}
reply = {"result": "temperature was set"}
result = await self._send(message, reply)
return result
async def set_target_temperature(self, temperature: int, devices: [NeoStat]):
"""
Sets the thermostat's temperature

View File

@ -165,6 +165,10 @@ class NeoStat(SimpleNamespace):
result = await self._hub.set_target_temperature(temperature, [self])
return result
async def set_cool_temp(self, temperature: int):
result = await self._hub.set_cool_temp(temperature, [self])
return result
async def set_diff(self, switching_differential: int):
result = await self._hub.set_diff(switching_differential, [self])
return result