Skip to content

Commit

Permalink
Bugfix matching devices
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Mar 12, 2024
1 parent f20faf4 commit 5c4f838
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/battery_notes/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ async def get_device_battery_details(
):
matching_devices.append(device)

if matching_devices is None or not matching_devices or len(matching_devices) == 0:
return None

# Check if any matching devices have specified hw_version
for device in matching_devices:
if device.get("hw_version", "").casefold() == str(model_info.hw_version or "").casefold():
Expand Down

0 comments on commit 5c4f838

Please sign in to comment.