From e07e672a42515b71adcca5b50869b1c4bacf0d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 22 Nov 2020 12:30:59 +0000 Subject: [PATCH] Add set temperature command. --- neohub.py | 14 ++++++++++++++ neostat.py | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/neohub.py b/neohub.py index c17dd5e..e2005de 100644 --- a/neohub.py +++ b/neohub.py @@ -391,3 +391,17 @@ class NeoHub: result = await self._send(message, reply) return result + + async def set_temp(self, temperature: int, devices: [NeoStat]): + """ + Sets the thermostat's temperature + + The temperature will be reset once next comfort level is reached + """ + + names = [x.name for x in devices] + message = {"SET_TEMP": [temperature, names]} + reply = {"result": "temperature was set"} + + result = await self._send(message, reply) + return result diff --git a/neostat.py b/neostat.py index 360b032..100b997 100644 --- a/neostat.py +++ b/neostat.py @@ -75,3 +75,7 @@ class NeoStat: async def frost(self, state: bool): result = await self._hub.frost(state, [self]) return result + + async def set_temp(self, temperature: int): + result = await self._hub.set_temp(temperature, [self]) + return result