Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
Add last update to sensor attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
johanohly committed Jan 28, 2024
1 parent 7a8a1b1 commit 77fc16e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/bedste_lectio/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@ def native_value(self) -> str:
def extra_state_attributes(self) -> dict[str, any]:
"""Return the state attributes of the entity."""
entries = self.coordinator.data.get("skema")
return get_next_room(entries)
data = get_next_room(entries)
data.update({
"last_update": datetime.now(),
})
return data

0 comments on commit 77fc16e

Please sign in to comment.