Add method to set temperature format.

This commit is contained in:
Andrius Štikonas 2020-11-20 23:17:40 +00:00
parent 135c6033bc
commit 175497b15b
2 changed files with 14 additions and 3 deletions

View File

@ -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

View File

@ -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())