From a042c828c8ea376ab588131107f7e49a700afd8b Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Fri, 1 Nov 2024 10:12:57 +0000 Subject: [PATCH] Fix battery last reported event mistakenly firing on entities --- custom_components/battery_notes/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/battery_notes/__init__.py b/custom_components/battery_notes/__init__.py index 5e0ca54a..481ad918 100644 --- a/custom_components/battery_notes/__init__.py +++ b/custom_components/battery_notes/__init__.py @@ -398,7 +398,7 @@ async def handle_battery_last_reported(call): device: BatteryNotesDevice for device in hass.data[DOMAIN][DATA].devices.values(): - if device.coordinator.last_reported: + if device.coordinator.device_id and device.coordinator.last_reported: time_since_lastreported = ( datetime.fromisoformat(str(datetime.utcnow()) + "+00:00") - device.coordinator.last_reported