Class: OpenHAB::Core::Things::ChannelDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/openhab/core/things/channel_definition.rb

Overview

ChannelDefinition is a part of a ChannelGroupType that represents a functionality of it. Therefore Items can be linked a to a channel.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auto_update_policy:veto, ... (readonly)

Returns:

  • (:veto, :default, :recommend, nil)


39
40
41
# File 'lib/openhab/core/things/channel_definition.rb', line 39

def auto_update_policy
  get_auto_update_policy&.to_s&.downcase&.to_sym
end

#channel_typeChannelType (readonly)

Returns:



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
# File 'lib/openhab/core/things/channel_definition.rb', line 32

class ChannelDefinition
  extend Forwardable

  delegate channel_type: :channel_type_uid

  # @!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::ChannelDefinition #{id}"
    r += " channel_type_uid=#{channel_type_uid.inspect}" if channel_type_uid
    r += " #{label.inspect}" if label
    r += " description=#{description.inspect}" if description
    r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

  # @return [String]
  def to_s
    id.to_s
  end
end

#channel_type_uidChannelTypeUID (readonly)

Returns:



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
# File 'lib/openhab/core/things/channel_definition.rb', line 32

class ChannelDefinition
  extend Forwardable

  delegate channel_type: :channel_type_uid

  # @!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::ChannelDefinition #{id}"
    r += " channel_type_uid=#{channel_type_uid.inspect}" if channel_type_uid
    r += " #{label.inspect}" if label
    r += " description=#{description.inspect}" if description
    r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

  # @return [String]
  def to_s
    id.to_s
  end
end

#descriptionString? (readonly)

Returns:

  • (String, nil)


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
# File 'lib/openhab/core/things/channel_definition.rb', line 32

class ChannelDefinition
  extend Forwardable

  delegate channel_type: :channel_type_uid

  # @!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::ChannelDefinition #{id}"
    r += " channel_type_uid=#{channel_type_uid.inspect}" if channel_type_uid
    r += " #{label.inspect}" if label
    r += " description=#{description.inspect}" if description
    r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

  # @return [String]
  def to_s
    id.to_s
  end
end

#idString (readonly)

Returns:

  • (String)


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
# File 'lib/openhab/core/things/channel_definition.rb', line 32

class ChannelDefinition
  extend Forwardable

  delegate channel_type: :channel_type_uid

  # @!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::ChannelDefinition #{id}"
    r += " channel_type_uid=#{channel_type_uid.inspect}" if channel_type_uid
    r += " #{label.inspect}" if label
    r += " description=#{description.inspect}" if description
    r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

  # @return [String]
  def to_s
    id.to_s
  end
end

#labelString? (readonly)

Returns:

  • (String, nil)


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
# File 'lib/openhab/core/things/channel_definition.rb', line 32

class ChannelDefinition
  extend Forwardable

  delegate channel_type: :channel_type_uid

  # @!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::ChannelDefinition #{id}"
    r += " channel_type_uid=#{channel_type_uid.inspect}" if channel_type_uid
    r += " #{label.inspect}" if label
    r += " description=#{description.inspect}" if description
    r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

  # @return [String]
  def to_s
    id.to_s
  end
end

#propertiesHash<String, String> (readonly)

Returns:

  • (Hash<String, String>)


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
# File 'lib/openhab/core/things/channel_definition.rb', line 32

class ChannelDefinition
  extend Forwardable

  delegate channel_type: :channel_type_uid

  # @!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::ChannelDefinition #{id}"
    r += " channel_type_uid=#{channel_type_uid.inspect}" if channel_type_uid
    r += " #{label.inspect}" if label
    r += " description=#{description.inspect}" if description
    r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

  # @return [String]
  def to_s
    id.to_s
  end
end

Instance Method Details

#inspectString

Returns:

  • (String)


44
45
46
47
48
49
50
51
52
# File 'lib/openhab/core/things/channel_definition.rb', line 44

def inspect
  r = "#<OpenHAB::Core::Things::ChannelDefinition #{id}"
  r += " channel_type_uid=#{channel_type_uid.inspect}" if channel_type_uid
  r += " #{label.inspect}" if label
  r += " description=#{description.inspect}" if description
  r += " auto_update_policy=#{auto_update_policy}" if auto_update_policy
  r += " properties=#{properties.to_h}" unless properties.empty?
  "#{r}>"
end

#to_sString

Returns:

  • (String)


55
56
57
# File 'lib/openhab/core/things/channel_definition.rb', line 55

def to_s
  id.to_s
end