Switch powerwall to async_on_remove (#34472)
This commit is contained in:
parent
4a788b62d1
commit
a5af746013
1 changed files with 3 additions and 5 deletions
|
@ -53,8 +53,6 @@ class PowerWallEntity(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)
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue