boc-tothefuture / openhab-jruby

JRuby Libraries for Openhab
Eclipse Public License 2.0
6 stars 9 forks source link

Addon: scope conversion to global variable #564

Closed jimtng closed 2 years ago

jimtng commented 2 years ago

The current addon has a hard coded list of variables given through scopeValues to be converted into globals. This would cause a problem when a new object/variable is added to openhab.

In #563, I am testing a new addon that would simply check if the first character of the name is lowercase instead. The PR for the addon is https://github.com/openhab/openhab-addons/pull/12539

Specifically, I came across an interesting feature from jsscripting that allows storing an object to be shared across multiple rules. I am currently requesting for that feature to be moved into core.

It added a new scoped variable called sharedcache which is not in the hard-coded list of global variables in the jrubyscripting addon, hence the need to change the addon to be more general.

jimtng commented 2 years ago

The addon PR has been merged.