-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Move uptime from relative time to absolute time #43623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
But how does this new sensor tells me the uptime of the system? It will only show last boot? |
@yuvalabou because of the device class the frontend will show the relative time. As for any other use case, the time can be calculated if needed. Essentially, knowing when the last boot was, allows one to calculate it in any way one wants. |
Could not place a comment on the specific line, but:
Is unused. |
You are right, strange flake8 didn't notice. Simone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with this. I think I want a second opinion from @balloob on this one. Mainly because of the impact of the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Breaking change
In order to optimize stability and performance of HomeAssistant, sensors should use only absolute time values (store the date of the event) and not relative time values (seconds from event) so the db value doesn't change each seconds.
"uptime" integration is one leftover, so to adhere to HomeAssistant development rules, the sensor is now changed to a timestamp.
Please review your lovelace config to reflect the change.
Moved uptime sensor from relative time to absolute time
Proposed change
Moved uptime sensor from relative time to absolute time
Type of change
Example entry for
configuration.yaml
:# Example configuration.yaml
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: