mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Velbus unsubscribe to the status updates on removal (#135530)
This commit is contained in:
parent
38dcc782d1
commit
c489f94026
@ -40,6 +40,10 @@ class VelbusEntity(Entity):
|
|||||||
"""Add listener for state changes."""
|
"""Add listener for state changes."""
|
||||||
self._channel.on_status_update(self._on_update)
|
self._channel.on_status_update(self._on_update)
|
||||||
|
|
||||||
|
async def async_will_remove_from_hass(self) -> None:
|
||||||
|
"""Remove listener for state changes."""
|
||||||
|
self._channel.remove_on_status_update(self._on_update)
|
||||||
|
|
||||||
async def _on_update(self) -> None:
|
async def _on_update(self) -> None:
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ rules:
|
|||||||
docs-high-level-description: done
|
docs-high-level-description: done
|
||||||
docs-installation-instructions: done
|
docs-installation-instructions: done
|
||||||
docs-removal-instructions: done
|
docs-removal-instructions: done
|
||||||
entity-event-setup: todo
|
entity-event-setup: done
|
||||||
entity-unique-id: done
|
entity-unique-id: done
|
||||||
has-entity-name: todo
|
has-entity-name: todo
|
||||||
runtime-data: done
|
runtime-data: done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user