Cancel listen task when setting the Matter fabric label fails (#127423)
When setting the Matter fabric label fails, the listen task should be cancelled to prevent the task from running indefinitely. Follow up for #127252.pull/127450/head
parent
bbf8a49ac8
commit
e15ae6bea3
|
@ -139,6 +139,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
hass.config.location_name or "Home"
|
||||
)
|
||||
except (NotConnected, MatterError) as err:
|
||||
listen_task.cancel()
|
||||
raise ConfigEntryNotReady("Failed to set default fabric label") from err
|
||||
|
||||
if DOMAIN not in hass.data:
|
||||
|
|
Loading…
Reference in New Issue