Fix Tado signal collisons (#34118)
* Fix signal collision in tado with multiple accounts Tado signals were not unique enough to prevent collisions between accounts with the same zone ids. * Bump upstream to fix multiple tado accounts * switch signal undo to async_on_remove * Bump version now that upstream is released * bump python-tado * While its only the dep that changed since the last run, best to force another CI to be sure
This commit is contained in:
1 parent
61a5793073
commit
37463d655a
8 files changed
+45
-46
No files matched your search
@@ -104,20 +104,18 @@ class TadoZoneSensor(TadoZoneEntity, Entity):
|
||||
self._state = None
|
||||
self._state_attributes = None
|
||||
self._tado_zone_data = None
|
||||
self._undo_dispatcher = None
|
||||
|
||||
async def async_will_remove_from_hass(self):
|
||||
"""When entity will be removed from hass."""
|
||||
if self._undo_dispatcher:
|
||||
self._undo_dispatcher()
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
"""Register for sensor updates."""
|
||||
|
||||
self._undo_dispatcher = async_dispatcher_connect(
|
||||
self.hass,
|
||||
SIGNAL_TADO_UPDATE_RECEIVED.format("zone", self.zone_id),
|
||||
self._async_update_callback,
|
||||
self.async_on_remove(
|
||||
async_dispatcher_connect(
|
||||
self.hass,
|
||||
SIGNAL_TADO_UPDATE_RECEIVED.format(
|
||||
self._tado.device_id, "zone", self.zone_id
|
||||
),
|
||||
self._async_update_callback,
|
||||
)
|
||||
)
|
||||
self._async_update_zone_data()
|
||||
|
||||
@@ -245,20 +243,18 @@ class TadoDeviceSensor(Entity):
|
||||
self._state = None
|
||||
self._state_attributes = None
|
||||
self._tado_device_data = None
|
||||
self._undo_dispatcher = None
|
||||
|
||||
async def async_will_remove_from_hass(self):
|
||||
"""When entity will be removed from hass."""
|
||||
if self._undo_dispatcher:
|
||||
self._undo_dispatcher()
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
"""Register for sensor updates."""
|
||||
|
||||
self._undo_dispatcher = async_dispatcher_connect(
|
||||
self.hass,
|
||||
SIGNAL_TADO_UPDATE_RECEIVED.format("device", self.device_id),
|
||||
self._async_update_callback,
|
||||
self.async_on_remove(
|
||||
async_dispatcher_connect(
|
||||
self.hass,
|
||||
SIGNAL_TADO_UPDATE_RECEIVED.format(
|
||||
self._tado.device_id, "device", self.device_id
|
||||
),
|
||||
self._async_update_callback,
|
||||
)
|
||||
)
|
||||
self._async_update_device_data()
|
||||
|
||||
|
||||
Reference in new issue
Block a user