Unsub dispatcher when removing entity from hass (#33510)
* Unsub dispatcher when removing entity from hass * Update homeassistant/components/plaato/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/volvooncall/__init__.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
1 parent
314bc07cee
commit
4ebbabcdd1
71 files changed
+355
-209
No files matched your search
@@ -437,4 +437,6 @@ class NestSensorDevice(Entity):
|
||||
"""Update sensor state."""
|
||||
await self.async_update_ha_state(True)
|
||||
|
||||
async_dispatcher_connect(self.hass, SIGNAL_NEST_UPDATE, async_update_state)
|
||||
self.async_on_remove(
|
||||
async_dispatcher_connect(self.hass, SIGNAL_NEST_UPDATE, async_update_state)
|
||||
)
|
||||
@@ -151,7 +151,9 @@ class NestThermostat(ClimateDevice):
|
||||
"""Update device state."""
|
||||
await self.async_update_ha_state(True)
|
||||
|
||||
async_dispatcher_connect(self.hass, SIGNAL_NEST_UPDATE, async_update_state)
|
||||
self.async_on_remove(
|
||||
async_dispatcher_connect(self.hass, SIGNAL_NEST_UPDATE, async_update_state)
|
||||
)
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
|
||||
Reference in new issue
Block a user