Add set_format.
This commit is contained in:
parent
6973ec8d17
commit
f51fb1ce32
18
neohub.py
18
neohub.py
|
@ -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
|
||||
|
|
6
test.py
6
test.py
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue