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

[rules] Preserve disabled state of switchable rules after restarting #271

Merged
merged 3 commits into from
Jun 11, 2023

Conversation

simonihmig
Copy link
Contributor

When a SwitchableJSRule has been switched off and I change something in my script so that it restarts, then after recreation of the rules the switch item would correctly be in OFF state given its historical state, but the rule it represents would still be enabled. Which basically means whenever your script restarts, all previously disabled rules would get enabled, without noticing...

This should fix it, tested locally.

When a `SwitchableJSRule` has been switched off and I change something in my script so that it restarts, then after recreation of the rules the switch item would correctly be in `OFF` state given its historical state, but the rule it represents would still be enabled. Which basically means whenever your script restarts, all previously disabled rules would get enabled, without noticing...

This should fix it, tested locally.

Signed-off-by: Simon Ihmig <simon.ihmig@gmail.com>
@simonihmig simonihmig requested a review from a team as a code owner June 11, 2023 09:24
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@florian-h05 florian-h05 added this to the to be released milestone Jun 11, 2023
@florian-h05 florian-h05 added the bug Something isn't working label Jun 11, 2023
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 merged commit c1e5298 into openhab:main Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants