Skip to content

Commit

Permalink
Cancel listen task when setting the Matter fabric label fails (home-a…
Browse files Browse the repository at this point in the history
…ssistant#127423)

When setting the Matter fabric label fails, the listen task should be
cancelled to prevent the task from running indefinitely.

Follow up for home-assistant#127252.
  • Loading branch information
agners authored Oct 3, 2024
1 parent bbf8a49 commit e15ae6b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions homeassistant/components/matter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ async def on_hass_stop(event: Event) -> None:
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:
Expand Down

0 comments on commit e15ae6b

Please sign in to comment.