mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Switch griddy to async_on_remove (#34471)
This commit is contained in:
parent
ccc818266b
commit
4a788b62d1
@ -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)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user