mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Use async_on_remove for WLED DataUpdateCoordinator (#36640)
This commit is contained in:
parent
ddb85cee7b
commit
59f935beb0
@ -180,11 +180,9 @@ class WLEDEntity(Entity):
|
|||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Connect to dispatcher listening for entity data notifications."""
|
"""Connect to dispatcher listening for entity data notifications."""
|
||||||
|
self.async_on_remove(
|
||||||
self.coordinator.async_add_listener(self.async_write_ha_state)
|
self.coordinator.async_add_listener(self.async_write_ha_state)
|
||||||
|
)
|
||||||
async def async_will_remove_from_hass(self) -> None:
|
|
||||||
"""Disconnect from update signal."""
|
|
||||||
self.coordinator.async_remove_listener(self.async_write_ha_state)
|
|
||||||
|
|
||||||
async def async_update(self) -> None:
|
async def async_update(self) -> None:
|
||||||
"""Update WLED entity."""
|
"""Update WLED entity."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user