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
@@ -234,10 +234,12 @@ class ComfoConnectSensor(Entity):
|
||||
_LOGGER.debug(
|
||||
"Registering for sensor %s (%d)", self._sensor_type, self._sensor_id
|
||||
)
|
||||
async_dispatcher_connect(
|
||||
self.hass,
|
||||
SIGNAL_COMFOCONNECT_UPDATE_RECEIVED.format(self._sensor_id),
|
||||
self._handle_update,
|
||||
self.async_on_remove(
|
||||
async_dispatcher_connect(
|
||||
self.hass,
|
||||
SIGNAL_COMFOCONNECT_UPDATE_RECEIVED.format(self._sensor_id),
|
||||
self._handle_update,
|
||||
)
|
||||
)
|
||||
await self.hass.async_add_executor_job(
|
||||
self._ccb.comfoconnect.register_sensor, self._sensor_id
|
||||
|
||||
Reference in new issue
Block a user