@@ -100,9 +100,7 @@ def model(self):
100
100
model = "CC2538" if self .application ._znp .nvram .align_structs else "CC2531"
101
101
version = "Home 1.2" if self .application ._znp .version == 1.2 else "3.0.x"
102
102
103
- build = self .application ._version_rsp .CodeRevision
104
-
105
- return f"{ model } , Z-Stack { version } (build { build } )"
103
+ return f"{ model } , Z-Stack { version } (build { self .application ._zstack_build_id } )"
106
104
107
105
108
106
class ControllerApplication (zigpy .application .ControllerApplication ):
@@ -328,7 +326,7 @@ async def _startup(self, auto_form=False, force_form=False, read_only=False):
328
326
LOGGER .info ("Network settings" )
329
327
LOGGER .info (" Model: %s" , self .zigpy_device .model )
330
328
LOGGER .info (" Z-Stack version: %s" , self ._znp .version )
331
- LOGGER .info (" Z-Stack build id: %s" , self ._version_rsp . CodeRevision )
329
+ LOGGER .info (" Z-Stack build id: %s" , self ._zstack_build_id )
332
330
LOGGER .info (" Max concurrent requests: %s" , max_concurrent_requests )
333
331
LOGGER .info (" Channel: %s" , self .channel )
334
332
LOGGER .info (" PAN ID: 0x%04X" , self .pan_id )
@@ -704,10 +702,11 @@ async def permit(self, time_s=60, node=None):
704
702
705
703
# If joins were permitted through a specific router, older Z-Stack builds
706
704
# did not allow the key to be distributed unless the coordinator itself was
707
- # also permitting joins.
705
+ # also permitting joins. This also needs to happen if we're permitting joins
706
+ # through the coordinator itself.
708
707
#
709
708
# Fixed in https://github.com/Koenkk/Z-Stack-firmware/commit/efac5ee46b9b437
710
- if time_s == 0 or self ._version_rsp . CodeRevision < 20210708 :
709
+ if time_s == 0 or self ._zstack_build_id < 20210708 or node == self . ieee :
711
710
response = await self ._znp .request_callback_rsp (
712
711
request = c .ZDO .MgmtPermitJoinReq .Req (
713
712
AddrMode = t .AddrMode .NWK ,
@@ -979,6 +978,14 @@ async def on_af_message(self, msg: c.AF.IncomingMsg.Callback) -> None:
979
978
# Internal methods #
980
979
####################
981
980
981
+ @property
982
+ def _zstack_build_id (self ) -> t .uint32_t :
983
+ """
984
+ Z-Stack build ID, more recently the build date.
985
+ """
986
+
987
+ return self ._version_rsp .CodeRevision
988
+
982
989
@property
983
990
def zigpy_device (self ) -> zigpy .device .Device :
984
991
"""
0 commit comments