Skip to content

Commit

Permalink
Fix received_command examples (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimtng authored Apr 11, 2024
1 parent b0ed922 commit 5cc4acc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ Furthermore, you can manipulate the managed timers using the built-in {OpenHAB::
```ruby
# timers is a special object to access the timers created with an id
rule "cancel all timers" do
received_command Cancel_All_Timers, to: ON # Send a command to this item to cancel all timers
received_command Cancel_All_Timers, command: ON # Send a command to this item to cancel all timers
run do
gOutdoorLights.members.each do |item_as_timer_id|
timers.cancel(item_as_timer_id)
Expand All @@ -925,7 +925,7 @@ rule "cancel all timers" do
end

rule "reschedule all timers" do
received_command Reschedule_All_Timers, to: ON # Send a command to this item to restart all timers
received_command Reschedule_All_Timers, command: ON # Send a command to this item to restart all timers
run do
gOutdoorLights.members.each do |item_as_timer_id|
timers.reschedule(item_as_timer_id)
Expand Down Expand Up @@ -1467,7 +1467,7 @@ See {OpenHAB::DSL::Rules::BuilderDSL#updated #updated}

```ruby
rule "Received a command" do
received_command DoorBell, to: ON
received_command DoorBell, command: ON
run do |event|
notify "Someone pressed the door bell"
play_sound "doorbell.mp3"
Expand Down Expand Up @@ -1673,7 +1673,7 @@ See {group::OpenHAB::DSL::Rules::BuilderDSL::Execution-Blocks Execution Blocks}
A rule with a trigger and an execution block can be created with just one line.

```ruby
received_command(My_Switch, to: ON) { My_Light.on }
received_command(My_Switch, command: ON) { My_Light.on }
```

See {OpenHAB::DSL::Rules::Terse Terse Rules} for full details.
Expand Down

0 comments on commit 5cc4acc

Please sign in to comment.