Skip to content

Commit b634cfa

Browse files
committed
address review change requests
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
1 parent 33235b1 commit b634cfa

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tutorials/getting_started/rules_advanced.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ actions.ScriptExecution.createTimer(time.ZonedDateTime.now().plusMinutes(30), li
211211
::: tab JRuby
212212

213213
Timers are created by calling the [after](https://openhab.github.io/openhab-jruby/main/OpenHAB/DSL.html#after-class_method) method.
214-
It accepts a [Duration](https://openhab.github.io/openhab-jruby/main/OpenHAB/CoreExt/Java/Duration.html), a Ruby [Time](https://docs.ruby-lang.org/en/master/Time.htmll), or a java [ZonedDateTime](https://openhab.github.io/openhab-jruby/main/OpenHAB/CoreExt/Java/ZonedDateTime.html) object to specify when the timer should execute.
214+
It accepts a [Duration](https://openhab.github.io/openhab-jruby/main/OpenHAB/CoreExt/Java/Duration.html), a Ruby [Time](https://docs.ruby-lang.org/en/master/Time.htmll), or a Java [ZonedDateTime](https://openhab.github.io/openhab-jruby/main/OpenHAB/CoreExt/Java/ZonedDateTime.html) object to specify when the timer should execute.
215215
Most of the time, a Duration is used, and the helper library offers a [convenient syntax](https://openhab.github.io/openhab-jruby/main/index.html#durations), e.g. `30.minutes`, to create a Duration object.
216216

217217
```ruby
@@ -273,8 +273,10 @@ It could be coded to reuse the Timer instead which is an exercise for the reader
273273

274274
In JRuby, an easy way to reschedule the same timer is done by providing a unique `id` to the timer.
275275
This is called a [reentrant timer](https://openhab.github.io/openhab-jruby/main/OpenHAB/DSL.html#reentrant-timers).
276+
When [after](https://openhab.github.io/openhab-jruby/main/OpenHAB/DSL.html#after-class_method) with an `id` is executed the first time, a new timer will be created.
277+
Subsequent executions will reschedule the same timer instead of creating a new timer.
276278

277-
The most convenient ID to use is the Item object for which the timer is operating, but you can use anything as the ID, e.g. a String, a number, the rule uid, etc.
279+
The most convenient `id` to use is the Item object for which the timer is operating, but you can use anything as the ID, e.g. a String, a number, the rule uid, etc.
278280

279281
```ruby
280282
logger.info "Motion was detected"
@@ -402,8 +404,8 @@ gemfile do
402404
end
403405
```
404406

405-
[Personal libraries](https://openhab.github.io/openhab-jruby/main/index.html#shared-code) that contain your custom reusable constants, functions, data structures, and classes can be created and used inside your Script Actions and Conditions.
406-
Simply save a `.rb` file that contain your code in `$OH_CONF/automation/ruby/lib/` folder, then `require` it in your script.
407+
[Personal libraries](https://openhab.github.io/openhab-jruby/main/index.html#shared-code) that contain your custom reusable constants, methods, modules, and classes can be created and used inside your Script Actions and Conditions.
408+
Simply save a `.rb` file that contains your code in `$OH_CONF/automation/ruby/lib/` folder, then `require` it in your script.
407409

408410
For example, a personal library file in `$OH_CONF/automation/ruby/lib/mylibs.rb`:
409411

@@ -412,7 +414,7 @@ DESTINATION_EMAIL = "myemail@gmail.com"
412414

413415
def broadcast_alert(msg)
414416
Notification.send msg, title: "Alert!"
415-
things["mail:smtp:local"].send_mail(DESTINATION_EMAIL, "OpenHAB Alert", msg)
417+
things["mail:smtp:local"].send_mail(DESTINATION_EMAIL, "openHAB Alert", msg)
416418
end
417419
```
418420

0 commit comments

Comments
 (0)