From cf195e83ed928e64c81edaa92daea9e2db3fa181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 21 Nov 2020 01:56:01 +0000 Subject: [PATCH] Add get_holiday. --- neohub.py | 14 ++++++++++++-- test.py | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/neohub.py b/neohub.py index e8b2df3..4422acd 100644 --- a/neohub.py +++ b/neohub.py @@ -131,7 +131,7 @@ class NeoHub: Format is specified using ScheduleFormat enum: """ - message = {"SET_FORMAT": format: ScheduleFormat} + message = {"SET_FORMAT": format} reply = {"result": "Format was set"} result = await self._send(message, reply) @@ -146,8 +146,18 @@ class NeoHub: Instead of this function it is recommended to use frost on/off commands. """ - message = { "AWAY_ON" if state else "AWAY_OFF": 0} + message = {"AWAY_ON" if state else "AWAY_OFF": 0} reply = {"result": "away on" if state else "away off"} result = await self._send(message, reply) return result + + + async def get_holiday(self): + """ + Get list of holidays + """ + message = {"GET_HOLIDAY": 0} + + result = await self._send(message) + return result diff --git a/test.py b/test.py index 3f35a2f..91ce24a 100755 --- a/test.py +++ b/test.py @@ -15,7 +15,7 @@ async def run(): await hub.connect() system = await hub.get_system() print(vars(system)) - result = await hub.set_format(ScheduleFormat.ZERO) + result = await hub.get_holiday() print(result)