File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -587,18 +587,21 @@ async def remove_node(self, node_id: int) -> None:
587
587
Clusters .OperationalCredentials .Attributes .CurrentFabricIndex ,
588
588
)
589
589
fabric_index = node .attributes [attribute_path ]
590
-
591
- result : Clusters . OperationalCredentials . Commands . NOCResponse = (
592
- await self .chip_controller .SendCommand (
590
+ result : Clusters . OperationalCredentials . Commands . NOCResponse | None = None
591
+ try :
592
+ result = await self .chip_controller .SendCommand (
593
593
nodeid = node_id ,
594
594
endpoint = 0 ,
595
595
payload = Clusters .OperationalCredentials .Commands .RemoveFabric (
596
596
fabricIndex = fabric_index ,
597
597
),
598
598
)
599
- )
599
+ except ChipStackError as err :
600
+ LOGGER .warning ("Removing current fabric from device failed." , exc_info = err )
601
+ return
600
602
if (
601
- result .statusCode
603
+ result is None
604
+ or result .statusCode
602
605
== Clusters .OperationalCredentials .Enums .NodeOperationalCertStatusEnum .kOk
603
606
):
604
607
LOGGER .info ("Successfully removed Home Assistant fabric from device." )
You can’t perform that action at this time.
0 commit comments