diff --git a/custom_components/battery_notes/library.py b/custom_components/battery_notes/library.py index d1b73ad71..9b9a30523 100644 --- a/custom_components/battery_notes/library.py +++ b/custom_components/battery_notes/library.py @@ -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():