Comments (12)
I think just making it device class timestamp
is the way to go . If timestamp is in the future, we add "in X", else it's "X ago", depending on locale.
With experimental UI, people can choose if they want to see the relative time or the timestamp.
from architecture.
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.
from architecture.
Hmmm... Uptime: 3 hours ago
is a bit strange. So I will also change the default name to something like Restarted
or we create 2 new classes: one will show 3 hours
and the other will show 3 hours ago
from architecture.
Ok so I think there are three types of times that could be represented by sensors:
- "Static" time period, like the amount of time to get to work.
15 min
. Suggestion:time_period
(TBD) - A timestamp; an event at a specific time. As per @c727:
3 hours ago
. Suggestion:timestamp
(TBD) - Combination of the two. A time period that starts from a static timestamp like uptime. Suggestion:
relative_timestamp
(this issue)
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 👍
from architecture.
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.
from architecture.
And do you think we should support both: uptime: 3 hours
and restart: 3 hours _ago_
or is one enough?
from architecture.
Otto, I think for the static example we don't need a class as the state would not be updated every interval
from architecture.
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.
Also, keep in mind that the timestamp can be in the future: "Next Bus: in 5 minutes"
from architecture.
^it will only effect this one device_class
from architecture.
I also need one to display timestamp in future. For example, ETA: in 5 minutes
Ha, just saw @exxamalte comment after submit my comment.
from architecture.
Okay, we're going for timestamp
. UI support is landing in 0.84 for it: home-assistant/frontend#2087
UI will support all the different display options so we don't have to make a choice
from architecture.
Dev docs PR: home-assistant/developers.home-assistant#147
from architecture.
Related Issues (20)
- Splitting tests files in smaller files in components/modules tests HOT 1
- Feature Request HOT 1
- Add favorite position to Cover entity HOT 10
- Add feature light distribution control to LightEntity
- Add new CURRENT_HVAC constants HOT 1
- Add Home Appliance entity
- Officially allow enities to set their entity ID not based on their names HOT 2
- Custom Device Class for Binary Sensors HOT 9
- Installed homeassistant supervised on my Linux machine; can't get it to run. HOT 1
- Expand enqueue options media player HOT 2
- Extend Rest API - unique_id HOT 3
- Add "status" as an attribute to CalendarEvents HOT 5
- Add list of (upcoming) calendar events to templating HOT 1
- Creating automations on the fly HOT 1
- Optional health check HOT 2
- Open letter for improving Home Assistant's Authentication system HOT 7
- Add device_class Heater HOT 2
- Area Units HOT 3
- New Device class for Reactive Energy (varh) HOT 1
- "Lost" device HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from architecture.