Fix deCONZ change entity_id bug (#22974)

Fix deCONZ change entity_id bug
This commit is contained in:
Robert Svensson 2019-04-10 22:35:28 +02:00 committed by Martin Hjelmare
parent 72af4276b9
commit 6463b8165f

View File

@ -26,10 +26,9 @@ class DeconzDevice(Entity):
async def async_will_remove_from_hass(self) -> None:
"""Disconnect device object when removed."""
if self.unsub_dispatcher is not None:
self.unsub_dispatcher()
self._device.remove_callback(self.async_update_callback)
self._device = None
del self.gateway.deconz_ids[self.entity_id]
self.unsub_dispatcher()
@callback
def async_update_callback(self, reason):