Skip to content

Commit a042c82

Browse files
Fix battery last reported event mistakenly firing on entities
1 parent ceb6060 commit a042c82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

custom_components/battery_notes/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ async def handle_battery_last_reported(call):
398398

399399
device: BatteryNotesDevice
400400
for device in hass.data[DOMAIN][DATA].devices.values():
401-
if device.coordinator.last_reported:
401+
if device.coordinator.device_id and device.coordinator.last_reported:
402402
time_since_lastreported = (
403403
datetime.fromisoformat(str(datetime.utcnow()) + "+00:00")
404404
- device.coordinator.last_reported

0 commit comments

Comments
 (0)