Skip to content

Commit 5c4f838

Browse files
Bugfix matching devices
1 parent f20faf4 commit 5c4f838

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

custom_components/battery_notes/library.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ async def get_device_battery_details(
108108
):
109109
matching_devices.append(device)
110110

111+
if matching_devices is None or not matching_devices or len(matching_devices) == 0:
112+
return None
113+
111114
# Check if any matching devices have specified hw_version
112115
for device in matching_devices:
113116
if device.get("hw_version", "").casefold() == str(model_info.hw_version or "").casefold():

0 commit comments

Comments
 (0)