Support start_time and end_time query parameters#1030
Conversation
Signed-off-by: Nikolai Rozanov <nickolay.rozanov@gmail.com>
nhoening
left a comment
There was a problem hiding this comment.
Good start!
- Let's add a small link icon under the graphs on the asset page (or next to it), to copy the link to the current view. That would make it easy to share the current view with others.
- I would like the date picker to reflect the time range, as well.
- Please check the parameters better. They lead to an error if the timezone info is missing or if they are
None- see
One more thing I see (maybe not caused by this PR: When I reload the asset page, it doesn't pick the time range from the session (the /assets/<id>/chart endpoint calls set_session_variables("event_starts_after", "event_ends_before")), but goes back to the default (today + tomorrow). The sensor page seems to do that correct. This could also become another issue.
Signed-off-by: Nikolai Rozanov <nickolay.rozanov@gmail.com>
Signed-off-by: Nikolai Rozanov <nickolay.rozanov@gmail.com>
…url on copying Signed-off-by: Nikolai Rozanov <nickolay.rozanov@gmail.com>
Signed-off-by: Nikolai Rozanov <nickolay.rozanov@gmail.com>
nhoening
left a comment
There was a problem hiding this comment.
Great work, almost there.
I noticed one potential small bug: When I select a few days in the datepicker, e.g. 22.-25 of April, then copy the link and apply it, then the date picker has marked only 22.-24. of April.
When I set the timezone offset of the end_date in the URL to 00:00 and reload, it shows 22.-25. In base.html, line 470f, the picker throws off hours, that might be the reason.
We can also make a new issue out of this, it wasn't caused by this PR.
Signed-off-by: Nikolai Rozanov <nickolay.rozanov@gmail.com>
Signed-off-by: Nikolai Rozanov <nickolay.rozanov@gmail.com>
|
Please add a changelog entry, then we'll merge! |
Signed-off-by: Nikolai Rozanov <nickolay.rozanov@gmail.com>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Description
Support start_time and end_time query parameters for GET /assets/<id> call
Look & Feel
.
How to test
Pass new parameters to GET /assets/<id>, check we get data that is more recent than start_time and older than end_time
Further Improvements
.
Related Items
.