From: Oleg Andreych Date: Sun, 4 Feb 2024 10:22:02 +0000 (+0500) Subject: [groovyscripting] Described a way for code reuse (#16361) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=179e9a997a778dbf79aa3d73da46f90361a549db;p=openhab-addons.git [groovyscripting] Described a way for code reuse (#16361) Signed-off-by: Oleg Andreych --- diff --git a/bundles/org.openhab.automation.groovyscripting/README.md b/bundles/org.openhab.automation.groovyscripting/README.md index 6b67d42823..ef3c9e845a 100644 --- a/bundles/org.openhab.automation.groovyscripting/README.md +++ b/bundles/org.openhab.automation.groovyscripting/README.md @@ -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.