]> git.basschouten.com Git - openhab-addons.git/commitdiff
[groovyscripting] Described a way for code reuse (#16361)
authorOleg Andreych <kjiec4@gmail.com>
Sun, 4 Feb 2024 10:22:02 +0000 (15:22 +0500)
committerGitHub <noreply@github.com>
Sun, 4 Feb 2024 10:22:02 +0000 (11:22 +0100)
Signed-off-by: Oleg Andreych <kjiec4@gmail.com>
bundles/org.openhab.automation.groovyscripting/README.md

index 6b67d428230a635986ea182b63842b6e663d04ab..ef3c9e845a93de38d017bfcb21e6ceafcfe79642 100644 (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.