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:
David F. Mulcahey authored and GitHub committed 2020-01-21 06:07:47 -05:00
1 parent bc6603d8d7
commit 41014d73be
3 files changed
+9 -10

No files matched your search

+4 -2
View File
@@ -165,8 +165,10 @@ class ZHADevice(LogMixin):
@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):
@@ -135,8 +135,6 @@ class ZHAGateway:
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)
)
@@ -160,9 +158,6 @@ class ZHAGateway:
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,
@@ -336,9 +331,6 @@ class ZHAGateway:
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(