[groovyscripting] Described a way for code reuse (#16361)

Signed-off-by: Oleg Andreych <kjiec4@gmail.com>
This commit is contained in:
Oleg Andreych 2024-02-04 15:22:02 +05:00 committed by GitHub
parent 8e48c8b12e
commit 179e9a997a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,6 +21,13 @@ log:set DEBUG org.openhab.core.automation
For more information on the available APIs in scripts see the [JSR223 Scripting]({{base}}/configuration/jsr223.html) documentation.
## Code reuse
One can place *.groovy files with Groovy classes under `automation/groovy` configuration directory.
Those classes can be imported in JSR-223 scripts or the UI rules action with the usual Groovy `import` statement.
To apply shared code changes, one has to restart the `openHAB Core :: Bundles :: Automation` bundle on the Console or an openHAB instance altogether.
## Script Examples
Groovy scripts provide access to almost all the functionality in an openHAB runtime environment.