Switch griddy to async_on_remove (#34471)

This commit is contained in:
J. Nick Koston 2020-04-20 13:21:00 -05:00 committed by GitHub
parent ccc818266b
commit 4a788b62d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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._coordinator.async_add_listener(self.async_write_ha_state) self.async_on_remove(
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)