-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[opensprinkler] Add Veto and some default times to state options. #11816
Conversation
<state readOnly="false" pattern="%.0f min"> | ||
<options> | ||
<option value="15s">15 Seconds</option> | ||
<option value="1min">1 Minute</option> | ||
<option value="5min">5 Minutes</option> |
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.
Do your options cover all possible values or only few of them ?
Is the pattern still necessary ? For other values ?
I have a doubt about the values in your options with different units. What unit is used when building the channel state in the binding.
Is it something you tested ?
Same comments for the other channel (rainDelay).
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.
- Covers values that most users should be happy with. Metadata can be added to change these default values if they do not suit and I have tested doing this. The issue IMHO is when no defaults are provided the control/widgets default to ANALIZE and showing a graph instead of offering a list of suitable commands to send. For a new openHAB user these changes are far better and also saves time for experienced users if the defaults are suitable.
- RE pattern: I have removed it for the
nextDuration
as the pattern was not necessary. For the rainDelay channel the API uses hours so I would prefer this gets displayed by default so if people see the TRACE logs they are less likely to get confused. Users can over ride the pattern with metadata. Originally when the binding was merged the ANALIZE feature did not take UOM into account when stored in persistence and this worked around that, not sure if this is fixed now in newer openHAB cores as I have seen it mentioned a few times. - The rainDelay has a state that the API will count down in hours. The code does handle all the different units and this is something I have tested for 10+ months now as I have been using Metadata to add the options in different units.
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.
I have never played with Number:Time but if you set 24 hours as value, your final value as a string will be 1d and not 24h ?
And for the other channel, are you sure you will get 1min rather than 60s for example?
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.
All I know is that I have tested it, and it works as I don't know how the UOM works in depth internally. When the command is sent, the device is queried and the response back from the device updates the channels state in HOURS as per the pattern. The channel that has had the pattern removed can at times display the result in seconds if for example a time of 4 days is selected it can change to be shown in seconds. Most of the time it displays the selected option as the nextDuration, as the device does not have a state for this. It is only a virtual control used when you turn a watering zone on.
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.
I am not clear with that. Can another maintainer please comment & review? @fwolter @cweitkamp @wborn @kaikreuzer
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.
I've never tested if a StringType sent to a Channel, defined in state options and the Channel linked to an UoM Item converts correctly when the string is suffixed with the unit. There's a QuantityType constructor that accepts strings in the format defined in above state options. I think it can work and I trust in @Skinah if he says he tested it, that it works.
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.
In this case, if you think this is ok, please merge this PR @fwolter
And please also run the maven command to update the default i18n properties file.
|
55149f1
to
6c39281
Compare
I tried to run I got these lines...
|
Build failed. Please apply spotless: |
A soon as you fixed the spotless problem, I will run the i18n tool for you and create a PR to your repo. |
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
79f14e2
to
7d258c8
Compare
Spotless was fine on my system, so I did another rebase and force push and now it shows as sorted. |
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@Skinah : I pushed a PR to your repo with the result of the run of the i18n translation tool. |
Update default translations properties Signed-off-by: Matthew Skinner <matt@pcmus.com>
thanks, changes have been merged. |
@fwolter : please take the lead to review this PR |
…enhab#11816) * Add default times to state options. Signed-off-by: Matthew Skinner <matt@pcmus.com> * remove pattern Signed-off-by: Matthew Skinner <matt@pcmus.com> * Update default translations properties Signed-off-by: Laurent Garnier <lg.hc@free.fr> Co-authored-by: Laurent Garnier <lg.hc@free.fr> Signed-off-by: Michael Schmidt <mi.schmidt.83@gmail.com>
…enhab#11816) * Add default times to state options. Signed-off-by: Matthew Skinner <matt@pcmus.com> * remove pattern Signed-off-by: Matthew Skinner <matt@pcmus.com> * Update default translations properties Signed-off-by: Laurent Garnier <lg.hc@free.fr> Co-authored-by: Laurent Garnier <lg.hc@free.fr>
…enhab#11816) * Add default times to state options. Signed-off-by: Matthew Skinner <matt@pcmus.com> * remove pattern Signed-off-by: Matthew Skinner <matt@pcmus.com> * Update default translations properties Signed-off-by: Laurent Garnier <lg.hc@free.fr> Co-authored-by: Laurent Garnier <lg.hc@free.fr>
…enhab#11816) * Add default times to state options. Signed-off-by: Matthew Skinner <matt@pcmus.com> * remove pattern Signed-off-by: Matthew Skinner <matt@pcmus.com> * Update default translations properties Signed-off-by: Laurent Garnier <lg.hc@free.fr> Co-authored-by: Laurent Garnier <lg.hc@free.fr> Signed-off-by: Nick Waterton <n.waterton@outlook.com>
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
…enhab#11816) * Add default times to state options. Signed-off-by: Matthew Skinner <matt@pcmus.com> * remove pattern Signed-off-by: Matthew Skinner <matt@pcmus.com> * Update default translations properties Signed-off-by: Laurent Garnier <lg.hc@free.fr> Co-authored-by: Laurent Garnier <lg.hc@free.fr>
…enhab#11816) * Add default times to state options. Signed-off-by: Matthew Skinner <matt@pcmus.com> * remove pattern Signed-off-by: Matthew Skinner <matt@pcmus.com> * Update default translations properties Signed-off-by: Laurent Garnier <lg.hc@free.fr> Co-authored-by: Laurent Garnier <lg.hc@free.fr> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
PR does two things.
Signed-off-by: Matthew Skinner matt@pcmus.com