From 175497b15b70e8e71a98a8e0ba335d3bbf112318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Fri, 20 Nov 2020 23:17:40 +0000 Subject: [PATCH] Add method to set temperature format. --- neohub.py | 13 ++++++++++++- test.py | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/neohub.py b/neohub.py index 1c651f6..9f36532 100644 --- a/neohub.py +++ b/neohub.py @@ -98,7 +98,18 @@ class NeoHub: """ message = {"SET_CHANNEL": channel} - reply = {"result":"Trying to change channel"} + reply = {"result": "Trying to change channel"} + + result = await self._send(message, reply) + return result + + async def set_temp_format(self, temp_format): + """ + Set temperature format to C or F + """ + + message = {"SET_TEMP_FORMAT": temp_format} + reply = {"result": f"Temperature format set to {temp_format}"} result = await self._send(message, reply) return result diff --git a/test.py b/test.py index 5f13c4c..36cc089 100755 --- a/test.py +++ b/test.py @@ -14,9 +14,9 @@ async def run(): await hub.connect() firmware_version = await hub.firmware() print(firmware_version) - result = await hub.set_channel(11) + result = await hub.set_temp_format("C") print(result) -logging.basicConfig(level=logging.ERROR) +logging.basicConfig(level=logging.DEBUG) asyncio.run(run())