mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Switch griddy to async_on_remove (#34471)
This commit is contained in:
@@ -70,8 +70,6 @@ class GriddyPriceSensor(Entity):
|
|||||||
|
|
||||||
async def async_added_to_hass(self):
|
async def async_added_to_hass(self):
|
||||||
"""Subscribe to updates."""
|
"""Subscribe to updates."""
|
||||||
|
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):
|
|
||||||
"""Undo subscription."""
|
|
||||||
self._coordinator.async_remove_listener(self.async_write_ha_state)
|
|
||||||
|
Reference in New Issue
Block a user