-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Need a name for sensor device class to show relative time #39
Comments
I mean it might be appear as a period in the frontend, but in the back end it's just a timestamp, right? If we were to call it "time period" I'm sure that could cause some confusion when someone tries to use this device class to show a static time period, like travel time to work. So I would say "timestamp" would be more appropriate. |
Hmmm... |
Ok so I think there are three types of times that could be represented by sensors:
Obviously, it won't be possible to accommodate all of these in a single device class and we don't need the other device classes yet, but naming these consistently from the start is definitely good 👍 |
I guess if we keep device classes to the content, timestamp is in this case the most appropriate. I guess the frontend will need to be updated to render it then both by showing the timestamp and showing how long it was ago. Depending on the data, one could be more important than the other. |
And do you think we should support both: |
Otto, I think for the static example we don't need a class as the state would not be updated every interval |
Displaying a timestamp as a relative time from now is very use-case dependent, so keeping data type and view type independent would be preferable. |
^it will only effect this one device_class |
I also need one to display timestamp in future. For example, ETA: Ha, just saw @exxamalte comment after submit my comment. |
I think just making it device class With experimental UI, people can choose if they want to see the relative time or the timestamp. |
Okay, we're going for UI will support all the different display options so we don't have to make a choice |
Dev docs PR: home-assistant/developers.home-assistant#147 |
Background is this PR: home-assistant/core#14983 about the HA uptime sensor. Currently it's updating its state every 30 sec and flooding the state machine.
The state of the new sensor class will be an ISO formatted datetime (that you set once) and on the frontend we will show it as relative time like
3 days ago
and keep it updated there. (balloobs's idea)Class name suggestions:
The text was updated successfully, but these errors were encountered: