Add permit_join and remove zone functions.

This commit is contained in:
Andrius Štikonas 2020-11-22 11:13:24 +00:00
parent 6c699feeb3
commit cbe9d0e418
2 changed files with 33 additions and 0 deletions

View File

@ -327,3 +327,20 @@ class NeoHub:
result = await self._send(message, reply)
return result
async def permit_join(self, name, timeout_s=120):
"""
Permit new thermostat to join network
name: new zone will be added with this name
timeout: duration of discovery mode in seconds
To actually join network you need to select 01
from the thermostat's setup menu.
"""
message = {"PERMIT_JOIN": [timeout_s, name]}
reply = {"result": "network allows joining"}
result = await self._send(message)
return result

View File

@ -47,3 +47,19 @@ class NeoStat:
if result:
self.name = new_name
return result
async def remove(self):
"""
Removes this zone
If successful, thermostat will be disconnected from the hub
Note that it takes a few seconds to remove thermostat
New get_zones call will still return the original list
during that period.
"""
message = {"REMOVE_ZONE": self.name}
reply = {"result": "zone removed"}
result = await self._hub._send(message, reply)
return result