Add set_format.

This commit is contained in:
Andrius Štikonas 2020-11-20 23:39:20 +00:00
parent 6973ec8d17
commit f51fb1ce32
2 changed files with 21 additions and 3 deletions

View File

@ -109,6 +109,7 @@ class NeoHub:
result = await self._send(message, reply)
return result
async def set_temp_format(self, temp_format):
"""
Set temperature format to C or F
@ -119,3 +120,20 @@ class NeoHub:
result = await self._send(message, reply)
return result
async def set_format(self, format):
"""
Sets timer format
"NONPROGRAMMABLE" - non programmable (time clocks cannot be non programmable)
"24HOURSFIXED" - same format every day of the week
"5DAY/2DAY" - 5 day / 2 day
"7DAY" - 7 day (every day different)
"""
message = {"SET_FORMAT": format}
reply = {"result": "Format was set"}
result = await self._send(message, reply)
return result

View File

@ -12,9 +12,9 @@ import logging
async def run():
hub = neohub.NeoHub()
await hub.connect()
firmware_version = await hub.firmware()
print(firmware_version)
result = await hub.set_temp_format("C")
system = await hub.get_system()
print(vars(system))
result = await hub.set_format("NONPROGRAMMABLE")
print(result)