Skip to content

Commit

Permalink
Fix battery last reported event mistakenly firing on entities
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Nov 1, 2024
1 parent ceb6060 commit a042c82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/battery_notes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a042c82

Please sign in to comment.