Skip to content

Commit

Permalink
Rearrange ensure_states! doc for clarity (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimtng authored Oct 28, 2023
1 parent 34e2ff1 commit a607c5c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/openhab/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,15 @@ def store_states(*items)

#
# Permanently enable conditional execution of commands and updates for the current thread.
#
# When conditional executions are enabled, commands and updates will only be sent if the
# item's current state is not the same as the command or updated state.
# This eliminates the need to chain the command and update calls through
# {DSL::Items::Ensure::Ensurable#ensure ensure}.
#
# When conditional executions are enabled either by this method or within a block of {ensure_states},
# commands and updates can still be forcefully executed using the corresponding bang methods, e.g.
# `Item1.on!`, `Item1.command!(50)`, or `Item1.update!(ON)`. This eliminates the need to chain the
# command calls through {DSL::Items::Ensure::Ensurable#ensure ensure}.
# `Item1.on!`, `Item1.command!(50)`, or `Item1.update!(ON)`.
#
# @note This method is only intended for use at the top level of rule
# scripts. If it's used within library methods, or hap-hazardly within
Expand Down

0 comments on commit a607c5c

Please sign in to comment.