From 28edc8a72309a46a873b69c81a28ecf1342667f9 Mon Sep 17 00:00:00 2001 From: Alex X Date: Mon, 30 Dec 2024 12:49:45 +0300 Subject: [PATCH] Fix bug with battery for xiaomi.sensor_occupy.03 #1532 --- custom_components/xiaomi_gateway3/hass/add_entitites.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/xiaomi_gateway3/hass/add_entitites.py b/custom_components/xiaomi_gateway3/hass/add_entitites.py index 3b167d48..485f8a62 100644 --- a/custom_components/xiaomi_gateway3/hass/add_entitites.py +++ b/custom_components/xiaomi_gateway3/hass/add_entitites.py @@ -120,7 +120,8 @@ def handle_lazy_entities( def add_lazy_entity(attr: str) -> XEntity: lazy_attrs.remove(attr) - conv = next(i for i in device.converters if i.attr == attr) + # important to check non empty domain for some BLE devices + conv = next(i for i in device.converters if i.attr == attr and i.domain) entity = create_entity(device, conv) gw = CONFIG_ENTRIES.get(device.did)