Class: OpenHAB::Core::Things::ChannelUID
- Inherits:
-
Object
- Object
- OpenHAB::Core::Things::ChannelUID
- Defined in:
- lib/openhab/core/things/channel_uid.rb
Overview
ChannelUID represents a unique identifier for channels.
Instance Attribute Summary collapse
-
#item ⇒ Item?
readonly
Return the item if this channel is linked with an item.
-
#items ⇒ Array<Item>
readonly
Returns all of the channel's linked items.
-
#thing ⇒ Thing?
readonly
Return the thing this channel is associated with.
Instance Attribute Details
#item ⇒ Item? (readonly)
Return the item if this channel is linked with an item. If a channel is linked to more than one item, this method only returns the first item.
33 34 35 |
# File 'lib/openhab/core/things/channel_uid.rb', line 33 def item items.first end |
#items ⇒ Array<Item> (readonly)
Returns all of the channel's linked items.
44 45 46 47 |
# File 'lib/openhab/core/things/channel_uid.rb', line 44 def items registry = OSGi.service("org.openhab.core.thing.link.ItemChannelLinkRegistry") registry.get_linked_items(self).map { |i| Items::Proxy.new(i) } end |
#thing ⇒ Thing? (readonly)
Return the thing this channel is associated with.
21 22 23 |
# File 'lib/openhab/core/things/channel_uid.rb', line 21 def thing EntityLookup.lookup_thing(thing_uid) end |