From 7d9c8fdfa09323eef42a73dca295ab5fabe1d833 Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Mon, 27 Jan 2020 08:54:31 -0500 Subject: [PATCH] update remove service (#31164) --- homeassistant/components/zha/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/zha/api.py b/homeassistant/components/zha/api.py index 3871a26c9d7..ac88b7c1179 100644 --- a/homeassistant/components/zha/api.py +++ b/homeassistant/components/zha/api.py @@ -908,10 +908,10 @@ def async_load_api(hass): async def remove(service): """Remove a node from the network.""" - ieee = service.data.get(ATTR_IEEE_ADDRESS) + ieee = service.data[ATTR_IEEE_ADDRESS] zha_gateway = hass.data[DATA_ZHA][DATA_ZHA_GATEWAY] zha_device = zha_gateway.get_device(ieee) - if zha_device.is_coordinator: + if zha_device is not None and zha_device.is_coordinator: _LOGGER.info("Removing the coordinator (%s) is not allowed", ieee) return _LOGGER.info("Removing node %s", ieee)