-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Extend support to ISO8601 format for sitemap chart period parameter #3863
Conversation
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/6-month-period-of-charts-not-working/150768/9 |
Changes in Baisc UI and in Main UI (sitemap generator) Depends on openhab/openhab-core#3863 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
While you are at it, could you also add 3 months? |
Changes in Baisc UI and in Main UI (sitemap generator) Depends on openhab/openhab-core#3863 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Done |
Changes in Baisc UI and in Main UI (sitemap generator) Depends on openhab/openhab-core#3863 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/chart/ChartServlet.java
Outdated
Show resolved
Hide resolved
I'm not sure this is the way to go. Wouldn't it make more sense to use https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/Duration.html#parse(java.lang.CharSequence)? |
Can you explain a little more your thoughts @J-N-K ? |
ISO8601 defines how to specify periods of time and
If we detect a single letter, add
We then use |
@J-N-K Are you sure it will parse weeks, months and years? In my understanding it only starts with days (D). Or do you mean to convert these to days before parsing? |
It seems I misread the JavaDoc. I states ISO-8601, but only supports a subset of that. However, SO know the solution: https://stackoverflow.com/a/46258784.
|
@J-N-K : is your idea to extend the chart period syntax to what Period and Duration Java classes support? This syntax is not very user friendly. Or do we use them but restrict the user syntax to a number of hours or days or weeks or months or years? |
Ok, what I finally propose and what is, I believe, @J-N-K suggestion, is to accept a duration in the ISO-8601 notation in addition to our current simplified (and limited) notation. |
ea2efd9
to
6a7f8e6
Compare
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
6a7f8e6
to
fe68de7
Compare
Also add few new default periods in the selection of chart period Depends on openhab/openhab-core#3863 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/chart/ChartServlet.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
ebe2964
to
d45ed0f
Compare
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.
Thanks, I'll wait a bit if @mherwege wants to make comments. This is really a nice improvement.
The period parameter syntax was extended. Depends on openhab/openhab-core#3863 Also add few new default periods in the selection of chart period Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@openhab/ios-maintainers and @openhab/android-maintainers : please check any potential impact on the iOS and Android apps. |
As it's backwards compatible, there shouldn't be any direct impact, should there? |
Probably not but there was one little in Basic UI. |
See openhab/openhab-core#3863 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
In the Android app you can press on a chart to view it full screen and change the period. This list of periods needs to be extended. |
... but only if supported by core, hence the request to bump server API version. |
Yes, same in Basic UI. But my option is to provide a subset of predefined periods, the most common. I have slightly extended the predefined options. |
I have no idea where this version is set. @J-N-K any idea ? |
And we are not talking about the REST API but just the chart servlet API. |
For all intents and purposes of client apps the chart API is part of the REST API. Additionally, it doesn't have separate versioning. |
I agree, this should probably bump API version. @openhab/core-maintainers any other opinion? |
A bit OT, but could be the reason for a version bump added as javadoc where the version is defined? |
@mherwege : the sitemap generator in Main UI will probably require an enhancement, there is currently a restricted list of values allowed I believe. |
LGTM I will look into adjusting the UI sitemap definition checks. |
@kaikreuzer @J-N-K : API version increased. |
While you're at it, maybe add the full changelog? /**
* Version 1: initial version
* Version 2: include invisible widgets into sitemap response (#499)
* Version 3: Addition of anyFormat icon parameter (#978)
* Version 4: OH3, refactored extensions to addons (#1560)
* Version 5: transparent charts (#2502)
* Version 6: extended chart period parameter format (#3863)
*/ |
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
299fe49
to
e6b239a
Compare
I added the provided full history of the versions. |
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.
Many thanks, @lolodomo!
See openhab/openhab-core#3863 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
The period parameter syntax was extended. Depends on openhab/openhab-core#3863 Also add few new default periods in the selection of chart period Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Adjust sitemap configuration in main UI for recent changes in sitemap chart period configuration, see openhab/openhab-core#3863. Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
While I was searching where is defined the default configuration for RRD4j persistence service, I discovered the class I was not expecting such a class. I thought the class in core framework was enough. I have now a doubt and I should check again that the new duration format is properly used. |
Signed-off-by: Laurent Garnier lg.hc@free.fr