Unsubscribe from listeners when removing integration sensor (#69235)
This commit is contained in:
parent
f98b3e44de
commit
c79b361927
1 changed files with 4 additions and 2 deletions
|
@ -253,8 +253,10 @@ class IntegrationSensor(RestoreEntity, SensorEntity):
|
|||
self._state = integral
|
||||
self.async_write_ha_state()
|
||||
|
||||
async_track_state_change_event(
|
||||
self.hass, [self._sensor_source_id], calc_integration
|
||||
self.async_on_remove(
|
||||
async_track_state_change_event(
|
||||
self.hass, [self._sensor_source_id], calc_integration
|
||||
)
|
||||
)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Reference in a new issue