forked from andrius/neohubapi
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)
|
result = await self._send(message, reply)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
async def set_temp_format(self, temp_format):
|
async def set_temp_format(self, temp_format):
|
||||||
"""
|
"""
|
||||||
Set temperature format to C or F
|
Set temperature format to C or F
|
||||||
|
@ -119,3 +120,20 @@ class NeoHub:
|
||||||
|
|
||||||
result = await self._send(message, reply)
|
result = await self._send(message, reply)
|
||||||
return result
|
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():
|
async def run():
|
||||||
hub = neohub.NeoHub()
|
hub = neohub.NeoHub()
|
||||||
await hub.connect()
|
await hub.connect()
|
||||||
firmware_version = await hub.firmware()
|
system = await hub.get_system()
|
||||||
print(firmware_version)
|
print(vars(system))
|
||||||
result = await hub.set_temp_format("C")
|
result = await hub.set_format("NONPROGRAMMABLE")
|
||||||
print(result)
|
print(result)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue