Unsubscribe from listeners when removing threshold binary sensor (#69236)

pull/69413/head
Erik Montnemery 2022-04-04 11:02:30 +02:00 committed by Franck Nijhof
parent 9ec9dc047b
commit 73cd4a3366
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
1 changed files with 4 additions and 2 deletions

View File

@ -151,9 +151,11 @@ class ThresholdSensor(BinarySensorEntity):
_update_sensor_state()
self.async_write_ha_state()
self.async_on_remove(
async_track_state_change_event(
hass, [entity_id], async_threshold_sensor_state_listener
)
)
_update_sensor_state()
@property