Closed dilyanpalauzov closed 1 month ago
Are you aware of the last version that worked? Maybe @wborn can comment as most groovyscripting PR’s are his. I’m also interested in how this mechanism is setup, to provide future support
Are you aware of the last version that worked?
No, this is the first version I tried (OH 4.2.1).
I don't think it ever worked but I figured out a way for importing these additional classes in scripts with #17383.
https://www.openhab.org/docs/configuration/jsr223.html#default-preset-importpreset-not-required says that the OnOffType is available in Groovy, as part of the Default preset.
I create a file in openhab/automation/jsr223/onoff.groovy with content:
Loading it fails:
If I change onoff.groovy to:
there is no error on loading.
So in OpenHAB 4.2.1 the Default preset for Groovy does not include OnOffType, contrary to the statement at https://www.openhab.org/docs/configuration/jsr223.html#default-preset-importpreset-not-required.