@@ -170,16 +170,16 @@ async def network_commissioning_thread(self, parameter: commissioning.Parameters
170170 raise TypeError ("The device requires a Thread network dataset" )
171171
172172 self ._logger .info ("Adding Thread network" )
173- response = await self ._devCtrl .SendCommand (nodeid = node_id , endpoint = commissioning .ROOT_ENDPOINT_ID , payload = Clusters .NetworkCommissioning .Commands .AddOrUpdateThreadNetwork (
173+ response = await self ._devCtrl .SendCommand (nodeId = node_id , endpoint = commissioning .ROOT_ENDPOINT_ID , payload = Clusters .NetworkCommissioning .Commands .AddOrUpdateThreadNetwork (
174174 operationalDataset = parameter .thread_credentials ))
175175 if response .networkingStatus != Clusters .NetworkCommissioning .Enums .NetworkCommissioningStatusEnum .kSuccess :
176176 raise commissioning .CommissionFailure (f"Unexpected result for adding network: { response .networkingStatus } " )
177177
178- network_list = (await self ._devCtrl .ReadAttribute (nodeid = node_id , attributes = [(commissioning .ROOT_ENDPOINT_ID , Clusters .NetworkCommissioning .Attributes .Networks )], returnClusterObject = True ))[commissioning .ROOT_ENDPOINT_ID ][Clusters .NetworkCommissioning ].networks
178+ network_list = (await self ._devCtrl .ReadAttribute (nodeId = node_id , attributes = [(commissioning .ROOT_ENDPOINT_ID , Clusters .NetworkCommissioning .Attributes .Networks )], returnClusterObject = True ))[commissioning .ROOT_ENDPOINT_ID ][Clusters .NetworkCommissioning ].networks
179179 network_id = network_list [response .networkIndex ].networkID
180180
181181 self ._logger .info ("Enabling Thread network" )
182- response = await self ._devCtrl .SendCommand (nodeid = node_id , endpoint = commissioning .ROOT_ENDPOINT_ID , payload = Clusters .NetworkCommissioning .Commands .ConnectNetwork (networkID = network_id ), interactionTimeoutMs = self ._devCtrl .ComputeRoundTripTimeout (node_id , upperLayerProcessingTimeoutMs = 30000 ))
182+ response = await self ._devCtrl .SendCommand (nodeId = node_id , endpoint = commissioning .ROOT_ENDPOINT_ID , payload = Clusters .NetworkCommissioning .Commands .ConnectNetwork (networkID = network_id ), interactionTimeoutMs = self ._devCtrl .ComputeRoundTripTimeout (node_id , upperLayerProcessingTimeoutMs = 30000 ))
183183 if response .networkingStatus != Clusters .NetworkCommissioning .Enums .NetworkCommissioningStatusEnum .kSuccess :
184184 raise commissioning .CommissionFailure (f"Unexpected result for enabling network: { response .networkingStatus } " )
185185
@@ -190,29 +190,29 @@ async def network_commissioning_wifi(self, parameter: commissioning.Parameters,
190190 raise TypeError ("The device requires WiFi credentials" )
191191
192192 self ._logger .info ("Adding WiFi network" )
193- response = await self ._devCtrl .SendCommand (nodeid = node_id , endpoint = commissioning .ROOT_ENDPOINT_ID , payload = Clusters .NetworkCommissioning .Commands .AddOrUpdateWiFiNetwork (ssid = parameter .wifi_credentials .ssid , credentials = parameter .wifi_credentials .passphrase ))
193+ response = await self ._devCtrl .SendCommand (nodeId = node_id , endpoint = commissioning .ROOT_ENDPOINT_ID , payload = Clusters .NetworkCommissioning .Commands .AddOrUpdateWiFiNetwork (ssid = parameter .wifi_credentials .ssid , credentials = parameter .wifi_credentials .passphrase ))
194194 if response .networkingStatus != Clusters .NetworkCommissioning .Enums .NetworkCommissioningStatusEnum .kSuccess :
195195 raise commissioning .CommissionFailure (f"Unexpected result for adding network: { response .networkingStatus } " )
196196
197- network_list = (await self ._devCtrl .ReadAttribute (nodeid = node_id , attributes = [(commissioning .ROOT_ENDPOINT_ID , Clusters .NetworkCommissioning .Attributes .Networks )], returnClusterObject = True ))[commissioning .ROOT_ENDPOINT_ID ][Clusters .NetworkCommissioning ].networks
197+ network_list = (await self ._devCtrl .ReadAttribute (nodeId = node_id , attributes = [(commissioning .ROOT_ENDPOINT_ID , Clusters .NetworkCommissioning .Attributes .Networks )], returnClusterObject = True ))[commissioning .ROOT_ENDPOINT_ID ][Clusters .NetworkCommissioning ].networks
198198 network_id = network_list [response .networkIndex ].networkID
199199
200200 self ._logger .info ("Enabling WiFi network" )
201- response = await self ._devCtrl .SendCommand (nodeid = node_id , endpoint = commissioning .ROOT_ENDPOINT_ID , payload = Clusters .NetworkCommissioning .Commands .ConnectNetwork (networkID = network_id ), interactionTimeoutMs = self ._devCtrl .ComputeRoundTripTimeout (node_id , upperLayerProcessingTimeoutMs = 30000 ))
201+ response = await self ._devCtrl .SendCommand (nodeId = node_id , endpoint = commissioning .ROOT_ENDPOINT_ID , payload = Clusters .NetworkCommissioning .Commands .ConnectNetwork (networkID = network_id ), interactionTimeoutMs = self ._devCtrl .ComputeRoundTripTimeout (node_id , upperLayerProcessingTimeoutMs = 30000 ))
202202 if response .networkingStatus != Clusters .NetworkCommissioning .Enums .NetworkCommissioningStatusEnum .kSuccess :
203203 raise commissioning .CommissionFailure (f"Unexpected result for enabling network: { response .networkingStatus } " )
204204
205205 self ._logger .info ("WiFi network commissioning finished" )
206206
207207 async def network_commissioning (self , parameter : commissioning .Parameters , node_id : int ):
208- clusters = await self ._devCtrl .ReadAttribute (nodeid = node_id , attributes = [(Clusters .Descriptor .Attributes .ServerList )], returnClusterObject = True )
208+ clusters = await self ._devCtrl .ReadAttribute (nodeId = node_id , attributes = [(Clusters .Descriptor .Attributes .ServerList )], returnClusterObject = True )
209209 if Clusters .NetworkCommissioning .id not in clusters [commissioning .ROOT_ENDPOINT_ID ][Clusters .Descriptor ].serverList :
210210 self ._logger .info (
211211 f"Network commissioning cluster { commissioning .ROOT_ENDPOINT_ID } is not enabled on this device." )
212212 return
213213
214214 network_commissioning_cluster_state = (await self ._devCtrl .ReadAttribute (
215- nodeid = node_id ,
215+ nodeId = node_id ,
216216 attributes = [(commissioning .ROOT_ENDPOINT_ID , Clusters .NetworkCommissioning )], returnClusterObject = True ))[0 ][Clusters .NetworkCommissioning ]
217217
218218 if network_commissioning_cluster_state .networks :
0 commit comments