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
-
#channel ⇒ Channel?
readonly
Return the channel object for this channel.
-
#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
#channel ⇒ Channel? (readonly)
Return the channel object for this channel
31 32 33 |
# File 'lib/openhab/core/things/channel_uid.rb', line 31 def channel thing.channels[self] end |
#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.
43 44 45 |
# File 'lib/openhab/core/things/channel_uid.rb', line 43 def item items.first end |
#items ⇒ Array<Item> (readonly)
Returns all of the channel's linked items.
54 55 56 |
# File 'lib/openhab/core/things/channel_uid.rb', line 54 def items Links::Provider.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 |