-
-
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
[Exec 2.0] Not possible to only execute once #1533
Comments
Ok will fix that |
Signed-off-by: Karel Goderis <karel.goderis@me.com>
Signed-off-by: Karel Goderis <karel.goderis@me.com>
I confirm it works! Thank you! One additional comment. I see many confused questions on the OH forums, so maybe the readme should include more information. Also I guess setting the default to 0 would probably avoid a lot of questions. Cheers! |
Signed-off-by: Karel Goderis <karel.goderis@me.com>
I suggest that not specifying an interval should result in a one-shot execution when triggered by an input command or similar event. Using zero as a magic number for disabling the periodic execution is surprising for the user, especially since it's currently undocumented (AFAICT). An interval=0 should be an error since the user surely doesn't want the execution to run in a tight loop, which the value implies. It's also surprising that the execution runs periodically when no interval is requested or specified. |
@steve-bate err.... the actual code does not show this behaviour AFAIK. When Interval is not specified, the scheduling job is not scheduled for periodic execution. I do agree that when interval=0, a warning could be thrown in the logs, but then, it depends on the time-unit used, e.g. what if we would move to milliseconds as a unit, where would you put the threshold for a "tight loop"? 150ms?... |
Unless I'm mistaken, I was seeing this behavior on the master branch. When I didn't specify an interval I saw a callback once per minute which appeared to correspond to a recent change to make the default value for the interval be 60 seconds. I agree that any positive interval value is difficult to validate in a general way. |
@kgoderis, this is the configuration I saw that matched the behavior I was seeing (callback every 60 seconds without an interval specification). thing-types.xml <parameter name="interval" type="integer" required="false">
<label>Interval</label>
<description>Interval, in seconds, the command will be repeatedly executed</description>
<default>60</default>
</parameter> |
That is (to me) not normal as it has required=false
There is a check in the code on absence of this parameter, and if not present, nothing should be scheduled but I suspect the runtime to fill in the parameter automatically for us
@kaikreuzer what is the supposed behaviour when both required and default are defined on the Thing Type?
…Sent from my iPhone
On 6 Jan 2017, at 12:23, Steve Bate ***@***.***> wrote:
This is the configuration I saw that matched the behavior I was seeing (callback every 60 seconds without an interval specification).
thing-types.xml
<parameter name="interval" type="integer" required="false">
<label>Interval</label>
<description>Interval, in seconds, the command will be repeatedly executed</description>
<default>60</default>
</parameter>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@kaikreuzer Can you enlighten us, and/or merge https://github.com/openhab/openhab2-addons/pull/1637/files? |
A default value will be used, if nothing else is specified by the user. So as it is not required, the value will be 60 - apparently not what you intended, right? |
Signed-off-by: Karel Goderis <karel.goderis@me.com>
Having this code |
@mavris aren't you missing a comma before interval=0? |
* Fix for cron scheduler handling sunday as number Closes openhab#1532 Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Markus Storm <markus.storm@gmx.net>
Currently it is not possible to execute a command only once.
Default: interval = 15s
When putting interval=0, the handler throws an error.
It would be a good feature if it is possible to only execute a command once!
I hope @kgoderis can help?
Thanks!
The text was updated successfully, but these errors were encountered: