Switch griddy to async_on_remove (#34471)
This commit is contained in:
1 parent
ccc818266b
commit
4a788b62d1
1 file changed
+3
-5
@@ -70,8 +70,6 @@ class GriddyPriceSensor(Entity):
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
"""Subscribe to updates."""
|
||||
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)
|
||||
self.async_on_remove(
|
||||
self._coordinator.async_add_listener(self.async_write_ha_state)
|
||||
)
|
||||
Reference in new issue
Block a user