openhab / openhab-js

openHAB JavaScript Library for JavaScript Scripting Automation
https://www.openhab.org/addons/automation/jsscripting/
Eclipse Public License 2.0
38 stars 31 forks source link

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

Closed simonihmig closed 1 year ago

simonihmig commented 1 year ago

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.