Class: OpenHAB::Core::Events::ItemStateUpdatedEvent

Inherits:
ItemEvent show all
Includes:
ItemState
Defined in:
lib/openhab/core/events/item_state_updated_event.rb

Overview

AbstractEvent sent when an item's state has updated.

Since:

  • openHAB 4.0

Instance Attribute Summary collapse

Attributes included from ItemState

#state

Attributes inherited from ItemEvent

#group, #item

Attributes inherited from AbstractEvent

#attachment, #inputs, #source

Instance Method Summary collapse

Methods included from ItemState

#closed?, #down?, #null?, #off?, #on?, #open?, #paused?, #playing?, #state?, #undef?, #up?

Methods inherited from AbstractEvent

#payload

Instance Attribute Details

#last_state_updateZonedDateTime (readonly)

Returns the time the previous state update occurred.

Returns:

  • (ZonedDateTime)

    the time the previous state update occurred

Since:

  • openHAB 5.0



# File 'lib/openhab/core/events/item_state_updated_event.rb', line 18

Instance Method Details

#inspectString

Returns:

  • (String)

Since:

  • openHAB 4.0



23
24
25
26
27
28
29
# File 'lib/openhab/core/events/item_state_updated_event.rb', line 23

def inspect
  s = "#<OpenHAB::Core::Events::ItemStateUpdatedEvent item=#{item_name} state=#{item_state.inspect}"
  # @deprecated OH4.3 remove respond_to? check when dropping OH 4.3
  s += " last_state_update=#{last_state_update}" if respond_to?(:last_state_update) && last_state_update
  s += " source=#{source.inspect}" if source
  "#{s}>"
end