Oh this is good, as I’m stuck at the same LONG problem.
I recently upgraded from Openhab 3.4 to 4 and hue api v2.
Now I’m trying to get this blockly library from here https://community.openhab.org/t/how-to-convert-dsl-in-javascript-for-hue-dimmer-via-blockly/131090 to work with GraalJS.
I updated it with the new ‘dynamicCommand’ and the tip from Rich Koshak regarding the PercentType.
slots:
code:
- component: BlockCodeTemplate
config:
template: >
var runtime = require('@runtime');
{{utility:things}}.getActions('hue',{{input:THING_ID}}).dynamicCommand('brightness', new runtime.PercentType({{input:BRIGHTNESS}}), Long.valueOf({{input:FADING_TIME}}));
It’s the same error:
2023-08-29 23:41:05.913 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID '3aa6c5980f' failed: org.graalvm.polyglot.PolyglotException: ReferenceError: "Long" is not defined