Class: OpenHAB::Core::Things::ThingType

Inherits:
AbstractDescriptionType show all
Defined in:
lib/openhab/core/things/thing_type.rb

Overview

ThingType contains a list of channel group definitions, channel definitions and further meta information.

This description is used as template definition for the creation of the according concrete Thing object.

Instance Attribute Summary collapse

Attributes inherited from AbstractDescriptionType

#description, #label

Instance Method Summary collapse

Instance Attribute Details

#categoryString? (readonly)

Returns:

  • (String, nil)


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

class ThingType < AbstractDescriptionType
  class << self
    # @!visibility private
    def registry
      @registry ||= OSGi.service("org.openhab.core.thing.type.ThingTypeRegistry")
    end
  end

  # @!attribute [r] listed?
  # @return [true, false]
  alias_method :listed?, :is_listed

  # @return [String]
  def inspect
    r = "#<OpenHAB::Core::Things::ThingType #{uid}"
    r += " (unlisted)" unless listed?
    r += " category=#{category.inspect}" if category
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

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

#channel_definitionsArray<ChannelDefinition> (readonly)

Returns:



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

class ThingType < AbstractDescriptionType
  class << self
    # @!visibility private
    def registry
      @registry ||= OSGi.service("org.openhab.core.thing.type.ThingTypeRegistry")
    end
  end

  # @!attribute [r] listed?
  # @return [true, false]
  alias_method :listed?, :is_listed

  # @return [String]
  def inspect
    r = "#<OpenHAB::Core::Things::ThingType #{uid}"
    r += " (unlisted)" unless listed?
    r += " category=#{category.inspect}" if category
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

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

#channel_group_definitionsArray<ChannelGroupDefinition> (readonly)



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

class ThingType < AbstractDescriptionType
  class << self
    # @!visibility private
    def registry
      @registry ||= OSGi.service("org.openhab.core.thing.type.ThingTypeRegistry")
    end
  end

  # @!attribute [r] listed?
  # @return [true, false]
  alias_method :listed?, :is_listed

  # @return [String]
  def inspect
    r = "#<OpenHAB::Core::Things::ThingType #{uid}"
    r += " (unlisted)" unless listed?
    r += " category=#{category.inspect}" if category
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

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

#propertiesHash<String, String> (readonly)

Returns:

  • (Hash<String, String>)


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

class ThingType < AbstractDescriptionType
  class << self
    # @!visibility private
    def registry
      @registry ||= OSGi.service("org.openhab.core.thing.type.ThingTypeRegistry")
    end
  end

  # @!attribute [r] listed?
  # @return [true, false]
  alias_method :listed?, :is_listed

  # @return [String]
  def inspect
    r = "#<OpenHAB::Core::Things::ThingType #{uid}"
    r += " (unlisted)" unless listed?
    r += " category=#{category.inspect}" if category
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

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

#supported_bridge_type_uidsArray<String> (readonly)

Returns:



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

class ThingType < AbstractDescriptionType
  class << self
    # @!visibility private
    def registry
      @registry ||= OSGi.service("org.openhab.core.thing.type.ThingTypeRegistry")
    end
  end

  # @!attribute [r] listed?
  # @return [true, false]
  alias_method :listed?, :is_listed

  # @return [String]
  def inspect
    r = "#<OpenHAB::Core::Things::ThingType #{uid}"
    r += " (unlisted)" unless listed?
    r += " category=#{category.inspect}" if category
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

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

#uidChannelGroupTypeUID (readonly)

Returns:



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

class ThingType < AbstractDescriptionType
  class << self
    # @!visibility private
    def registry
      @registry ||= OSGi.service("org.openhab.core.thing.type.ThingTypeRegistry")
    end
  end

  # @!attribute [r] listed?
  # @return [true, false]
  alias_method :listed?, :is_listed

  # @return [String]
  def inspect
    r = "#<OpenHAB::Core::Things::ThingType #{uid}"
    r += " (unlisted)" unless listed?
    r += " category=#{category.inspect}" if category
    r += " properties=#{properties.to_h}" unless properties.empty?
    "#{r}>"
  end

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

Instance Method Details

#inspectString

Returns:

  • (String)


47
48
49
50
51
52
53
# File 'lib/openhab/core/things/thing_type.rb', line 47

def inspect
  r = "#<OpenHAB::Core::Things::ThingType #{uid}"
  r += " (unlisted)" unless listed?
  r += " category=#{category.inspect}" if category
  r += " properties=#{properties.to_h}" unless properties.empty?
  "#{r}>"
end

#to_sString

Returns:

  • (String)


56
57
58
# File 'lib/openhab/core/things/thing_type.rb', line 56

def to_s
  uid.to_s
end