File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,18 +97,19 @@ def observe_device(
9797 self .gateway = infuse_id
9898 if infuse_id not in self .devices :
9999 self .devices [infuse_id ] = self .DeviceState (infuse_id )
100+ dev = self .devices [infuse_id ]
100101 if network_id is not None :
101- self . devices [ infuse_id ] .network_id = network_id
102+ dev .network_id = network_id
102103 if device_key_id is not None :
103- if (
104- self .devices [infuse_id ].device_key_id is not None
105- and self .devices [infuse_id ].device_key_id != device_key_id
106- ):
104+ if device_key_id == dev .secondary_device_key_id :
105+ pass
106+ elif dev .device_key_id is not None and dev .device_key_id != device_key_id :
107107 raise DeviceKeyChangedError (f"Device key for { infuse_id :016x} has changed" )
108- self .devices [infuse_id ].device_key_id = device_key_id
108+ else :
109+ dev .device_key_id = device_key_id
109110 if bt_addr is not None :
110111 self .bt_addr [bt_addr ] = infuse_id
111- self . devices [ infuse_id ] .bt_addr = bt_addr
112+ dev .bt_addr = bt_addr
112113
113114 def observe_secondary_remote_public_key (self , infuse_id : int , secondary_pub_key : bytes ):
114115 if not self .is_local_root (secondary_pub_key ):
You can’t perform that action at this time.
0 commit comments