Skip to content

Commit 93d7667

Browse files
committed
Write the device logical type on startup, not just on formation
1 parent c3a988f commit 93d7667

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tests/test_application.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ def on_endpoint_deletion(req):
231231
NwkNvIds.CONCENTRATOR_RC,
232232
NwkNvIds.SRC_RTG_EXPIRY_TIME,
233233
NwkNvIds.NWK_CHILD_AGE_ENABLE,
234+
NwkNvIds.LOGICAL_TYPE,
234235
]:
235236
znp_server.reply_to(
236237
request=c.SYS.OSALNVWrite.Req(Id=nvid, Offset=0, partial=True),

zigpy_znp/zigbee/application.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ async def startup(self, auto_form=False):
329329
await self._znp.nvram_write(NwkNvIds.SRC_RTG_EXPIRY_TIME, t.uint8_t(255))
330330
await self._znp.nvram_write(NwkNvIds.NWK_CHILD_AGE_ENABLE, t.Bool(False))
331331

332+
# XXX: the undocumented `znpBasicCfg` request can do this
333+
await self._znp.nvram_write(
334+
NwkNvIds.LOGICAL_TYPE, t.DeviceLogicalType.Coordinator
335+
)
336+
332337
# Reset to make the above NVRAM writes take effect.
333338
# This also ensures any previously-started network joins don't continue.
334339
await self._reset()
@@ -481,11 +486,6 @@ async def form_network(self):
481486
NwkNvIds.STARTUP_OPTION, t.StartupOptions.ClearState
482487
)
483488

484-
# XXX: the undocumented `znpBasicCfg` request can do this
485-
await self._znp.nvram_write(
486-
NwkNvIds.LOGICAL_TYPE, t.DeviceLogicalType.Coordinator
487-
)
488-
489489
pan_id = self.config[conf.CONF_NWK][conf.CONF_NWK_PAN_ID]
490490
extended_pan_id = self.config[conf.CONF_NWK][conf.CONF_NWK_EXTENDED_PAN_ID]
491491

0 commit comments

Comments
 (0)