feat(show_last_updated): initial implementation #1289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breaking change
I would not consider it a breaking change as it only breaks an undocumented and incorrect behavior. However, for clarity's sake...
In the
yaml
if you were usingshow_last_updated
instead ofshow_last_changed
, it will now actually show the last updated value instead of the current behavior of showing the last changed value. This behavior in my opinion is a bug but wanted to state it here in case it broke someone's workflow.Proposed change
Fixes a bug. I can make a bug report if you want. I had not as I thought I'd just make a PR instead.
The bug is that
show_last_updated
in the yaml is treated as an alias forshow_last_changed
. This means if someone were to use it, the resulting time stamp would be incorrect since last changed and last updated, although can be the same value, are not always. This also adds the key into the GUI editor.In this screenshot the first timestamp is

last_changed
and the second islast_updated
. I was unsure which to make show up first so arbitrarilylast_updated
is shown second.Type of change
Example configuration
Example printscreens/gif
Before it showed

last_changed
when requestinglast_updated
After it shows

last_updated
when requestedCan also show both

Additional information
I think the above pretty sufficiently describes what this PR does but happy to answer any questions. The motivation behind this PR is that some sensors like
waze_travel_time
I like to see when it was last updated as opposed to changed so that I know how recently it determined person xyz is 45 min away. If someone stays still for an hour,last_changed
will show 1 hour ago butlast_updated
will show (usually) up to 5 min ago (assuming a 5 min update interval which is the default in this case).Additional documentation needed.
The documentation was added to the readme.
Checklist
If user exposed functionality or configuration variables are added/changed: