Class: OpenHAB::Core::Events::ItemEvent
- Inherits:
-
AbstractEvent
- Object
- AbstractEvent
- OpenHAB::Core::Events::ItemEvent
- Defined in:
- lib/openhab/core/events/item_event.rb
Overview
Adds methods to core openHAB ItemEvent to make it more natural in Ruby
Direct Known Subclasses
ItemCommandEvent, ItemStateChangedEvent, ItemStateEvent, ItemStateUpdatedEvent, ItemTimeSeriesUpdatedEvent
Instance Attribute Summary collapse
-
#group ⇒ Item?
readonly
Returns the group item whose member had triggered this event.
-
#item ⇒ Item
readonly
The item that triggered this event.
Attributes inherited from AbstractEvent
Method Summary
Methods inherited from AbstractEvent
Instance Attribute Details
#group ⇒ Item? (readonly)
Returns the group item whose member had triggered this event.
This is the equivalent of openHAB's triggeringGroup
, and it is only available
on a member-of-group trigger.
34 35 36 37 |
# File 'lib/openhab/core/events/item_event.rb', line 34 def group triggering_group = inputs&.[]("triggeringGroup") || Core.ui_context&.[](:triggeringGroup) Items::Proxy.new(triggering_group) if triggering_group end |
#item ⇒ Item (readonly)
Returns The item that triggered this event.
16 17 18 |
# File 'lib/openhab/core/events/item_event.rb', line 16 def item EntityLookup.lookup_item(item_name) end |