forked from andrius/neohubapi
Add method to set temperature format.
This commit is contained in:
parent
135c6033bc
commit
175497b15b
13
neohub.py
13
neohub.py
|
@ -98,7 +98,18 @@ class NeoHub:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
message = {"SET_CHANNEL": channel}
|
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)
|
result = await self._send(message, reply)
|
||||||
return result
|
return result
|
||||||
|
|
4
test.py
4
test.py
|
@ -14,9 +14,9 @@ async def run():
|
||||||
await hub.connect()
|
await hub.connect()
|
||||||
firmware_version = await hub.firmware()
|
firmware_version = await hub.firmware()
|
||||||
print(firmware_version)
|
print(firmware_version)
|
||||||
result = await hub.set_channel(11)
|
result = await hub.set_temp_format("C")
|
||||||
print(result)
|
print(result)
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.ERROR)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
asyncio.run(run())
|
asyncio.run(run())
|
||||||
|
|
Loading…
Reference in New Issue