Skip to content

Commit 28edc8a

Browse files
committed
Fix bug with battery for xiaomi.sensor_occupy.03 #1532
1 parent 6a240dd commit 28edc8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: custom_components/xiaomi_gateway3/hass/add_entitites.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ def handle_lazy_entities(
120120
def add_lazy_entity(attr: str) -> XEntity:
121121
lazy_attrs.remove(attr)
122122

123-
conv = next(i for i in device.converters if i.attr == attr)
123+
# important to check non empty domain for some BLE devices
124+
conv = next(i for i in device.converters if i.attr == attr and i.domain)
124125
entity = create_entity(device, conv)
125126

126127
gw = CONFIG_ENTRIES.get(device.did)

0 commit comments

Comments
 (0)