Skip to content
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

Move uptime / idletime from relative time to absolute time #12

Closed
epsimatic opened this issue Jan 10, 2021 · 4 comments · Fixed by #19
Closed

Move uptime / idletime from relative time to absolute time #12

epsimatic opened this issue Jan 10, 2021 · 4 comments · Fixed by #19
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@epsimatic
Copy link

epsimatic commented Jan 10, 2021

Proposed changes:

  • Add LastBoot sensor
  • Add LastActive sensor
  • Remove or disable by default UpTime sensor
  • Remove or disable by default IdleTime sensor
  • If ...Time sensors got disabled and not removed:
    • add a warning to documentation and/or runtime warning for people trying to turn these sensors on.

Rationale

As per this MR to Home-Assistant and around, we should avoid sensors that change values every second.

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.

@sleevezipper
Copy link
Owner

Thanks for creating an issue! This seems like a better way to do it.

@sleevezipper sleevezipper added enhancement New feature or request good first issue Good for newcomers labels Jan 10, 2021
@ChrisMancini
Copy link
Contributor

I have made the necessary changes to convert UpTime/IdleTime to LastBoot/LastActive. I have a local branch with my modifications. What is the proposed process to submit a PR?

@sleevezipper
Copy link
Owner

Oh that's great @ChrisMancini! Thanks a lot!

I think the only way to submit a PR is to fork this repo, make the changes and push, and then create a PR from your repo.

@sleevezipper sleevezipper linked a pull request Jan 12, 2021 that will close this issue
@sleevezipper
Copy link
Owner

Thanks a lot for your contribution @ChrisMancini. It has been merged and will be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants