diff --git a/neohubapi/neohub.py b/neohubapi/neohub.py index fce1ff9..ecff71b 100644 --- a/neohubapi/neohub.py +++ b/neohubapi/neohub.py @@ -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 diff --git a/neohubapi/neostat.py b/neohubapi/neostat.py index 8a12ff4..08c254a 100644 --- a/neohubapi/neostat.py +++ b/neohubapi/neostat.py @@ -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