Allow ZHA device creation for the Zigbee coordinator (#31032)
* allow zha device creation for coordinator * don't let coordinator get removed * fix truthy issue in logical device type
This commit is contained in:
parent
bc6603d8d7
commit
41014d73be
3 changed files with 9 additions and 10 deletions
|
@ -906,6 +906,11 @@ def async_load_api(hass):
|
|||
async def remove(service):
|
||||
"""Remove a node from the network."""
|
||||
ieee = service.data.get(ATTR_IEEE_ADDRESS)
|
||||
zha_gateway = hass.data[DATA_ZHA][DATA_ZHA_GATEWAY]
|
||||
zha_device = zha_gateway.get_device(ieee)
|
||||
if zha_device.is_coordinator:
|
||||
_LOGGER.info("Removing the coordinator (%s) is not allowed", ieee)
|
||||
return
|
||||
_LOGGER.info("Removing node %s", ieee)
|
||||
await application_controller.remove(ieee)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue