From 4cb636e9cbccf178ca65ae8ae0ae5ecc68c1cab8 Mon Sep 17 00:00:00 2001 From: Magnus Nordseth Date: Fri, 23 Aug 2024 21:28:02 +0000 Subject: [PATCH] Update device_entry for all devices, should solve issue for mixed sensor and actuator device like DVT_UP1AV --- custom_components/enet/device.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/custom_components/enet/device.py b/custom_components/enet/device.py index bb19944..dfe9eb1 100644 --- a/custom_components/enet/device.py +++ b/custom_components/enet/device.py @@ -10,7 +10,7 @@ async def async_setup_devices(coordinator): - """Manage setup of devices from Hue devices.""" + """Manage setup of devices from Enet devices.""" entry = coordinator.config_entry hass = coordinator.hass dev_reg = device_registry.async_get(hass) @@ -22,8 +22,7 @@ def add_device(enet_device): params = enet_device.get_device_info() return dev_reg.async_get_or_create(config_entry_id=entry.entry_id, **params) - # create/update all current devices found in controller + # create/update all current devices found in controller ensuring devices that only generate events also gets registered for enet_device in coordinator.hub.devices: - if all([not isinstance(c, ActuatorChannel) for c in enet_device.channels]): - hass_device_entry = add_device(enet_device) - enet_device.hass_device_entry = hass_device_entry + hass_device_entry = add_device(enet_device) + enet_device.hass_device_entry = hass_device_entry