From c1a609f927c0abf410516bd31b5348c5876f31cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Mon, 7 Dec 2020 00:43:54 +0000 Subject: [PATCH] Add (rate_of_change) VIEW_ROC command. --- neohub.py | 11 +++++++++++ neostat.py | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/neohub.py b/neohub.py index 4223966..9ce70be 100644 --- a/neohub.py +++ b/neohub.py @@ -434,3 +434,14 @@ class NeoHub: result = await self._send(message, reply) return result + + async def rate_of_change(self, devices: [NeoStat]): + """ + Returns time in minutes required to change temperature by 1 degree + """ + + names = [x.name for x in devices] + message = {"VIEW_ROC": names} + + result = await self._send(message) + return result diff --git a/neostat.py b/neostat.py index 3959aae..5b9fb57 100644 --- a/neostat.py +++ b/neostat.py @@ -83,3 +83,7 @@ class NeoStat: async def set_diff(self, switching_differential: int): result = await self._hub.set_diff(switching_differential, [self]) return result + + async def rate_of_change(self): + result = await self._hub.rate_of_change([self]) + return result