Skip to content

Commit 2e56a3b

Browse files
authored
Reset watchdog (#5)
1 parent 0e74079 commit 2e56a3b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

zigpy_deconz/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
'permit_join': (0x21, t.uint8_t),
6666
'protocol_version': (0x22, t.uint16_t),
6767
'nwk_update_id': (0x24, t.uint8_t),
68+
'watchdog_ttl': (0x26, t.uint32_t),
6869
}
6970

7071
NETWORK_PARAMETER_BY_ID = {v[0]: (k, v[1]) for k, v in NETWORK_PARAMETER.items()}

zigpy_deconz/zigbee/application.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ def __init__(self, api, database_file=None):
2727
self._nwk = 0
2828
self.discovering = False
2929

30+
asyncio.ensure_future(self._reset_watchdog())
31+
32+
async def _reset_watchdog(self):
33+
while True:
34+
await self._api.write_parameter(NETWORK_PARAMETER['watchdog_ttl'][0], 3600)
35+
await asyncio.sleep(1200)
36+
3037
async def startup(self, auto_form=False):
3138
"""Perform a complete application startup"""
3239
await self._api.device_state()

0 commit comments

Comments
 (0)