Module: OpenHAB::Core::Events::ItemState
- Included in:
- ItemStateChangedEvent, ItemStateEvent, ItemStateUpdatedEvent
- Defined in:
- lib/openhab/core/events/item_state_event.rb
Overview
Helpers common to ItemStateEvent and ItemStateChangedEvent.
Methods that refer to implicit conversion mean that for example a PercentType of 100% will be ‘true` for #on?, etc.
Instance Attribute Summary collapse
- #state ⇒ State? readonly
Instance Method Summary collapse
- #closed? ⇒ true, false
- #down? ⇒ true, false
- #inspect ⇒ String
- #null? ⇒ true, false
- #off? ⇒ true, false
- #on? ⇒ true, false
- #open? ⇒ true, false
- #paused? ⇒ true, false
- #playing? ⇒ true, false
- #state? ⇒ true, false
- #undef? ⇒ true, false
- #up? ⇒ true, false
Instance Attribute Details
Instance Method Details
#closed? ⇒ true, false
|
# File 'lib/openhab/core/events/item_state_event.rb', line 43
|
#down? ⇒ true, false
|
# File 'lib/openhab/core/events/item_state_event.rb', line 35
|
#inspect ⇒ String
73 74 75 76 77 |
# File 'lib/openhab/core/events/item_state_event.rb', line 73 def inspect s = "#<OpenHAB::Core::Events::#{self.class.simple_name} item=#{item_name} state=#{item_state.inspect}" s += " source=#{source.inspect}" if source "#{s}>" end |
#null? ⇒ true, false
|
# File 'lib/openhab/core/events/item_state_event.rb', line 19
|
#off? ⇒ true, false
|
# File 'lib/openhab/core/events/item_state_event.rb', line 27
|
#on? ⇒ true, false
|
# File 'lib/openhab/core/events/item_state_event.rb', line 23
|
#open? ⇒ true, false
|
# File 'lib/openhab/core/events/item_state_event.rb', line 39
|
#paused? ⇒ true, false
|
# File 'lib/openhab/core/events/item_state_event.rb', line 51
|
#playing? ⇒ true, false
|
# File 'lib/openhab/core/events/item_state_event.rb', line 47
|
#state? ⇒ true, false
60 61 62 |
# File 'lib/openhab/core/events/item_state_event.rb', line 60 def state? !item_state.is_a?(UnDefType) end |
#undef? ⇒ true, false
|
# File 'lib/openhab/core/events/item_state_event.rb', line 15
|