From 36c01042c1e67132f0398a45f584645dc47fd172 Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Mon, 29 Jul 2024 20:08:21 -0400 Subject: [PATCH] Enhance ZHA device removal (#122815) --- homeassistant/components/zha/websocket_api.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/homeassistant/components/zha/websocket_api.py b/homeassistant/components/zha/websocket_api.py index 97c625a27ed..0d4296e4b22 100644 --- a/homeassistant/components/zha/websocket_api.py +++ b/homeassistant/components/zha/websocket_api.py @@ -1311,12 +1311,8 @@ def async_load_api(hass: HomeAssistant) -> None: """Remove a node from the network.""" zha_gateway = get_zha_gateway(hass) ieee: EUI64 = service.data[ATTR_IEEE] - zha_device: Device | None = zha_gateway.get_device(ieee) - if zha_device is not None and zha_device.is_active_coordinator: - _LOGGER.info("Removing the coordinator (%s) is not allowed", ieee) - return _LOGGER.info("Removing node %s", ieee) - await application_controller.remove(ieee) + await zha_gateway.async_remove_device(ieee) async_register_admin_service( hass, DOMAIN, SERVICE_REMOVE, remove, schema=SERVICE_SCHEMAS[IEEE_SERVICE]