Skip to content
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

Update timer docs #161

Merged
merged 4 commits into from
Oct 4, 2022
Merged

Conversation

florian-h05
Copy link
Contributor

This improves the docs for actions.ScriptExecution Timers by explaining how to pass variables to the callback function.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 added the documentation Improvements or additions to documentation label Sep 28, 2022
@florian-h05
Copy link
Contributor Author

@rkoshak
Would be nice if you could have a quick look at the docs changes.

@rkoshak
Copy link
Contributor

rkoshak commented Sep 29, 2022

It looks good to me. The only thing I would add is the generic case of just passing one local variable to the timer instead of this. Theoretically (I've never done it though) that too would fix the variable same as the function generator does. But you can only pass the one variable.

@florian-h05
Copy link
Contributor Author

The only thing I would add is the generic case of just passing one local variable to the timer instead of this.

That‘s possible, but …

that too would fix the variable same as the function generator does. But you can only pass the one variable.

I expect that it is not the same as with the function generator, I think you can mutate the var after the creation of the timer.
I have to test this to check my assumption.

I will modify the docs to have two ways of passing a var to a timer, both ways support this. The main difference should be that in one case the var can be changed after timer creation.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05
Copy link
Contributor Author

@rkoshak
Ready for re-review.

Copy link
Contributor

@rkoshak rkoshak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one addition to add a comment explaining what happens when you change myVariable to "Hello mutation!".

@rkoshak
Copy link
Contributor

rkoshak commented Oct 3, 2022

Once that comment is added I think this is good to go.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 merged commit 915b164 into openhab:main Oct 4, 2022
@florian-h05 florian-h05 deleted the update-timer-docs branch October 4, 2022 11:29
@florian-h05 florian-h05 added this to the 2.x.x milestone Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants