From fc9141d1689195dabd40cdf4d31b64dbf3d88456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 22 Nov 2020 15:36:18 +0000 Subject: [PATCH] Add function to set switching differential. --- neohub.py | 18 ++++++++++++++++++ neostat.py | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/neohub.py b/neohub.py index e5d070d..7427849 100644 --- a/neohub.py +++ b/neohub.py @@ -415,3 +415,21 @@ class NeoHub: result = await self._send(message, reply) return result + + async def set_diff(self, switching_differential: int, devices: [NeoStat]): + """ + Sets the thermostat's switching differential + + -1: Undocumented option. Seems to set differential to 204. + 0: 0.5 degrees + 1: 1 degree + 2: 2 degrees + 3: 3 degrees + """ + + names = [x.name for x in devices] + message = {"SET_DIFF": [switching_differential, names]} + reply = {"result": "switching differential was set"} + + result = await self._send(message, reply) + return result diff --git a/neostat.py b/neostat.py index 100b997..3959aae 100644 --- a/neostat.py +++ b/neostat.py @@ -79,3 +79,7 @@ class NeoStat: async def set_temp(self, temperature: int): result = await self._hub.set_temp(temperature, [self]) return result + + async def set_diff(self, switching_differential: int): + result = await self._hub.set_diff(switching_differential, [self]) + return result