File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
custom_components/plugwise_usb Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -179,14 +179,16 @@ async def async_remove_config_entry_device(
179179) -> bool :
180180 """Remove a config entry from a device."""
181181 api_stick = config_entry .runtime_data [STICK ]
182- removable = not any (
183- identifier
184- for identifier in device_entry .identifiers
185- if identifier [0 ] == DOMAIN
186- and identifier [1 ] in (str (api_stick .mac_stick ), str (api_stick .mac_coordinator ))
187- )
182+ removable = False
183+ for identifier in device_entry .identifiers :
184+ if (
185+ identifier [0 ] == DOMAIN
186+ and (mac := identifier [1 ] in (str (api_stick .mac_stick ), str (api_stick .mac_coordinator )))
187+ ):
188+ removable = True
189+ break
190+
188191 if removable :
189- mac = identifier [1 ]
190192 try :
191193 await api_stick .unregister_node (mac )
192194 except NodeError as exc :
You can’t perform that action at this time.
0 commit comments