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

Fix SCRIPT transformation documentation #1944

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion addons/transformations.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ The `SCRIPT` transformation is available from the framework and needs no additio
It allows transforming values using any of the available scripting languages in openHAB (JSR-223 or DSL).

The script needs to be placed in the `$OPENHAB_CONF/transform` folder with an extension `.script` regardless of the actual script type.
When referencing a transformation, the script type must be prepended to the filename (e.g. `dsl:stringlength` for the DSL version of `stringlength.script`).
When referencing a transformation, the script type must be prepended to the filename (e.g. `dsl:stringlength.script` for the DSL version of `stringlength.script`).
Please note that you cannot have transformations with the same name and different languages as the file-extension is always `script`.
The script type depends on the scripting engine used, it is usually either the file extension or the MIME-type of the scripts.

The input value is injected into the script context as a string variable `input`.
The result needs to be returned from the script, it can have be `null` or value of type that properly implements `.toString()`.
Expand Down