From 27b997df3718227a48a812aba2e132ef0e272f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 3 Jan 2021 13:46:03 +0000 Subject: [PATCH] Add set_timer_hold function to netostat class. --- neohubapi/neohub.py | 4 +++- neohubapi/neostat.py | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/neohubapi/neohub.py b/neohubapi/neohub.py index aad2fa2..e1ba46c 100644 --- a/neohubapi/neohub.py +++ b/neohubapi/neohub.py @@ -476,7 +476,9 @@ class NeoHub: async def set_timer_hold(self, state: bool, minutes: int, devices: [NeoStat]): """ - Turns the output of timeclock on or off + Turns the output of timeclock on or off for certain duration + + This function works with NeoStats in timeclock mode """ names = [x.name for x in devices] diff --git a/neohubapi/neostat.py b/neohubapi/neostat.py index 4c05815..283488a 100644 --- a/neohubapi/neostat.py +++ b/neohubapi/neostat.py @@ -127,3 +127,12 @@ class NeoStat(SimpleNamespace): result = await self._hub.rate_of_change([self]) roc = result[self.name] return roc + + async def set_timer_hold(self, state: bool, minutes: int): + """ + Turns the output of timeclock on or off for certain duration + + Works only with NeoStats in timeclock mode + """ + result = await self._hub.set_timer_hold(state, minutes, [self]) + return result