forked from andrius/neohubapi
Add permit_join and remove zone functions.
This commit is contained in:
parent
6c699feeb3
commit
cbe9d0e418
17
neohub.py
17
neohub.py
|
@ -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
|
||||
|
|
16
neostat.py
16
neostat.py
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue