Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions homeassistant/components/zha/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,11 @@ async def permit(service):
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)

Expand Down
6 changes: 4 additions & 2 deletions homeassistant/components/zha/core/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ def is_mains_powered(self):
@property
def device_type(self):
"""Return the logical device type for the device."""
device_type = self._zigpy_device.node_desc.logical_type
return device_type.name if device_type else UNKNOWN
node_descriptor = self._zigpy_device.node_desc
return (
node_descriptor.logical_type.name if node_descriptor.is_valid else UNKNOWN
)

@property
def power_source(self):
Expand Down
8 changes: 0 additions & 8 deletions homeassistant/components/zha/core/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ async def init_with_semaphore(coro, semaphore):
await coro

for device in self.application_controller.devices.values():
if device.nwk == 0x0000:
continue
init_tasks.append(
init_with_semaphore(self.async_device_restored(device), semaphore)
)
Expand All @@ -160,9 +158,6 @@ def device_joined(self, device):

def raw_device_initialized(self, device):
"""Handle a device initialization without quirks loaded."""
if device.nwk == 0x0000:
return

manuf = device.manufacturer
async_dispatcher_send(
self._hass,
Expand Down Expand Up @@ -336,9 +331,6 @@ async def async_update_device_storage(self):

async def async_device_initialized(self, device):
"""Handle device joined and basic information discovered (async)."""
if device.nwk == 0x0000:
return

zha_device = self._async_get_or_create_device(device)

_LOGGER.debug(
Expand Down