Class: OpenHAB::Core::Things::ChannelType
- Inherits:
-
AbstractDescriptionType
- Object
- AbstractDescriptionType
- OpenHAB::Core::Things::ChannelType
- Defined in:
- lib/openhab/core/things/channel_type.rb
Overview
ChannelGroupType contains a list of channel definitions and further meta information such as label and description, which are generally used by user interfaces.
Instance Attribute Summary collapse
- #advanced? ⇒ true, false readonly
- #auto_update_policy ⇒ :veto, ... readonly
- #category ⇒ String? readonly
- #item_type ⇒ String readonly
- #kind ⇒ :state, :trigger readonly
- #tags ⇒ Set<String> readonly
- #uid ⇒ ChannelTypeUID readonly
Attributes inherited from AbstractDescriptionType
Instance Method Summary collapse
Instance Attribute Details
#advanced? ⇒ true, false (readonly)
44 |
# File 'lib/openhab/core/things/channel_type.rb', line 44 alias_method :advanced?, :advanced |
#auto_update_policy ⇒ :veto, ... (readonly)
51 52 53 |
# File 'lib/openhab/core/things/channel_type.rb', line 51 def auto_update_policy get_auto_update_policy&.to_s&.downcase&.to_sym end |
#category ⇒ String? (readonly)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/openhab/core/things/channel_type.rb', line 28 class ChannelType < AbstractDescriptionType class << self # @!visibility private def registry @registry ||= OSGi.service("org.openhab.core.thing.type.ChannelTypeRegistry") end end # @!attribute [r] kind # @return [:state, :trigger] def kind get_kind.to_s.to_sym end # @!attribute [r] advanced? # @return [true, false] alias_method :advanced?, :advanced # @!visibility private alias_method :state_description, :state # @!attribute [r] auto_update_policy # @return [:veto, :default, :recommend, nil] def auto_update_policy get_auto_update_policy&.to_s&.downcase&.to_sym end # @return [String] def inspect r = "#<OpenHAB::Core::Things::ChannelType #{uid}" r += " (#{kind})" unless kind == :state r += " (advanced)" if advanced? r += " item_type=#{item_type}" r += " tags=(#{tags.join(", ")})" unless tags.empty? r += " category=#{category.inspect}" if category r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy "#{r}>" end # @return [String] def to_s uid.to_s end end |
#item_type ⇒ String (readonly)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/openhab/core/things/channel_type.rb', line 28 class ChannelType < AbstractDescriptionType class << self # @!visibility private def registry @registry ||= OSGi.service("org.openhab.core.thing.type.ChannelTypeRegistry") end end # @!attribute [r] kind # @return [:state, :trigger] def kind get_kind.to_s.to_sym end # @!attribute [r] advanced? # @return [true, false] alias_method :advanced?, :advanced # @!visibility private alias_method :state_description, :state # @!attribute [r] auto_update_policy # @return [:veto, :default, :recommend, nil] def auto_update_policy get_auto_update_policy&.to_s&.downcase&.to_sym end # @return [String] def inspect r = "#<OpenHAB::Core::Things::ChannelType #{uid}" r += " (#{kind})" unless kind == :state r += " (advanced)" if advanced? r += " item_type=#{item_type}" r += " tags=(#{tags.join(", ")})" unless tags.empty? r += " category=#{category.inspect}" if category r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy "#{r}>" end # @return [String] def to_s uid.to_s end end |
#kind ⇒ :state, :trigger (readonly)
38 39 40 |
# File 'lib/openhab/core/things/channel_type.rb', line 38 def kind get_kind.to_s.to_sym end |
#tags ⇒ Set<String> (readonly)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/openhab/core/things/channel_type.rb', line 28 class ChannelType < AbstractDescriptionType class << self # @!visibility private def registry @registry ||= OSGi.service("org.openhab.core.thing.type.ChannelTypeRegistry") end end # @!attribute [r] kind # @return [:state, :trigger] def kind get_kind.to_s.to_sym end # @!attribute [r] advanced? # @return [true, false] alias_method :advanced?, :advanced # @!visibility private alias_method :state_description, :state # @!attribute [r] auto_update_policy # @return [:veto, :default, :recommend, nil] def auto_update_policy get_auto_update_policy&.to_s&.downcase&.to_sym end # @return [String] def inspect r = "#<OpenHAB::Core::Things::ChannelType #{uid}" r += " (#{kind})" unless kind == :state r += " (advanced)" if advanced? r += " item_type=#{item_type}" r += " tags=(#{tags.join(", ")})" unless tags.empty? r += " category=#{category.inspect}" if category r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy "#{r}>" end # @return [String] def to_s uid.to_s end end |
#uid ⇒ ChannelTypeUID (readonly)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/openhab/core/things/channel_type.rb', line 28 class ChannelType < AbstractDescriptionType class << self # @!visibility private def registry @registry ||= OSGi.service("org.openhab.core.thing.type.ChannelTypeRegistry") end end # @!attribute [r] kind # @return [:state, :trigger] def kind get_kind.to_s.to_sym end # @!attribute [r] advanced? # @return [true, false] alias_method :advanced?, :advanced # @!visibility private alias_method :state_description, :state # @!attribute [r] auto_update_policy # @return [:veto, :default, :recommend, nil] def auto_update_policy get_auto_update_policy&.to_s&.downcase&.to_sym end # @return [String] def inspect r = "#<OpenHAB::Core::Things::ChannelType #{uid}" r += " (#{kind})" unless kind == :state r += " (advanced)" if advanced? r += " item_type=#{item_type}" r += " tags=(#{tags.join(", ")})" unless tags.empty? r += " category=#{category.inspect}" if category r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy "#{r}>" end # @return [String] def to_s uid.to_s end end |
Instance Method Details
#inspect ⇒ String
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/openhab/core/things/channel_type.rb', line 56 def inspect r = "#<OpenHAB::Core::Things::ChannelType #{uid}" r += " (#{kind})" unless kind == :state r += " (advanced)" if advanced? r += " item_type=#{item_type}" r += " tags=(#{tags.join(", ")})" unless tags.empty? r += " category=#{category.inspect}" if category r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy "#{r}>" end |
#to_s ⇒ String
68 69 70 |
# File 'lib/openhab/core/things/channel_type.rb', line 68 def to_s uid.to_s end |