mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Bugfix ZHA device_removed() handler. (#23074)
This commit is contained in:
parent
2f17529f28
commit
479511ee42
@ -145,14 +145,14 @@ class ZHAGateway:
|
|||||||
|
|
||||||
def device_removed(self, device):
|
def device_removed(self, device):
|
||||||
"""Handle device being removed from the network."""
|
"""Handle device being removed from the network."""
|
||||||
device = self._devices.pop(device.ieee, None)
|
zha_device = self._devices.pop(device.ieee, None)
|
||||||
self._device_registry.pop(device.ieee, None)
|
self._device_registry.pop(device.ieee, None)
|
||||||
if device is not None:
|
if zha_device is not None:
|
||||||
device_info = async_get_device_info(self._hass, device)
|
device_info = async_get_device_info(self._hass, zha_device)
|
||||||
self._hass.async_create_task(device.async_unsub_dispatcher())
|
self._hass.async_create_task(zha_device.async_unsub_dispatcher())
|
||||||
async_dispatcher_send(
|
async_dispatcher_send(
|
||||||
self._hass,
|
self._hass,
|
||||||
"{}_{}".format(SIGNAL_REMOVE, str(device.ieee))
|
"{}_{}".format(SIGNAL_REMOVE, str(zha_device.ieee))
|
||||||
)
|
)
|
||||||
if device_info is not None:
|
if device_info is not None:
|
||||||
async_dispatcher_send(
|
async_dispatcher_send(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user