diff --git a/neohub.py b/neohub.py index 1c82705..1daea91 100644 --- a/neohub.py +++ b/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 diff --git a/neostat.py b/neostat.py index 8f47939..7fc0c6f 100644 --- a/neostat.py +++ b/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