Module: OpenHAB::DSL::Items::Ensure::Ensurable

Included in:
Core::Items::GroupItem::Members, Item
Defined in:
lib/openhab/dsl/items/ensure.rb

Overview

Contains the ‘ensure` method mixed into Item and Core::Items::GroupItem::Members

Instance Method Summary collapse

Instance Method Details

#ensureObject

Fluent method call that you can chain commands on to, that will then automatically ensure that the item is not in the command’s state before sending the command.

Examples:

Turn switch on only if it’s not on

MySwitch.ensure.on

Turn on all switches in a group that aren’t already on

MySwitchGroup.members.ensure.on


20
21
22
# File 'lib/openhab/dsl/items/ensure.rb', line 20

def ensure
  ItemDelegate.new(self)
end