diff --git a/concepts/rules.md b/concepts/rules.md index 7803f45f1..d05155a88 100644 --- a/concepts/rules.md +++ b/concepts/rules.md @@ -625,7 +625,7 @@ rule "Window open reminder" do changed gWindows.members, to: OPEN, for: 1.hour run do |event| # Item guaranteed to be OPEN here, no need to check - notify("#{event.item.label} is open for an hour!") + Notification.send("#{event.item.label} is open for an hour!") end end ``` diff --git a/configuration/jsr223.md b/configuration/jsr223.md index 62ec404ed..1a44bf102 100644 --- a/configuration/jsr223.md +++ b/configuration/jsr223.md @@ -89,7 +89,9 @@ sRule.setTriggers([ ]); automationManager.addRule(sRule); +``` +```js // And the same rule using the helper library: const { rules, triggers } = require('openhab'); @@ -185,7 +187,9 @@ s_rule.set_triggers([ ]) $automationManager.add_rule(s_rule) +``` +```ruby # And the same rule using the bundled helper library: rule "A Cron Rule in Ruby" do @@ -234,12 +238,18 @@ To facilitate JSR223 scripting, several openHAB-related variables are automatica They can be loaded into the script context using `scriptExtension.importPreset(String preset)`, e.g. `scriptExtension.importPreset("RuleSimple")`. The `default` preset is preloaded, so it does not require importing. -- [`Default`](#default-preset-importpreset-not-required) -- [`RuleSimple`](#rulesimple-preset) -- [`RuleSupport`](#rulesupport-preset) -- [`RuleFactories`](#rulefactories-preset) -- [`ScriptAction`](#scriptaction-preset) -- [`cache`](#cache-preset) +- [Overview](#overview) + - [Example rules for a first impression](#example-rules-for-a-first-impression) + - [Script Locations](#script-locations) + - [`ScriptExtension` Objects (all JSR223 languages)](#scriptextension-objects-all-jsr223-languages) + - [Default Preset (`importPreset` not required)](#default-preset-importpreset-not-required) + - [`events` operations](#events-operations) + - [RuleSimple Preset](#rulesimple-preset) + - [`RuleSupport` Preset](#rulesupport-preset) + - [`RuleFactories` Preset](#rulefactories-preset) + - [`ScriptAction` Preset](#scriptaction-preset) + - [`cache` Preset](#cache-preset) + - [`TriggerType` Objects (all JSR223 languages)](#triggertype-objects-all-jsr223-languages) #### Default Preset (`importPreset` not required)