Class: ESPHome::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/esphome/entity.rb

Defined Under Namespace

Modules: HasAssumedState, HasDeviceClass, HasState

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#deviceObject (readonly)

Returns the value of attribute device.



87
88
89
# File 'lib/esphome/entity.rb', line 87

def device
  @device
end

#disabled_by_defaultObject (readonly)

Returns the value of attribute disabled_by_default.



87
88
89
# File 'lib/esphome/entity.rb', line 87

def disabled_by_default
  @disabled_by_default
end

#entity_categoryObject (readonly)

Returns the value of attribute entity_category.



87
88
89
# File 'lib/esphome/entity.rb', line 87

def entity_category
  @entity_category
end

#iconObject (readonly)

Returns the value of attribute icon.



87
88
89
# File 'lib/esphome/entity.rb', line 87

def icon
  @icon
end

#keyObject (readonly)

Returns the value of attribute key.



87
88
89
# File 'lib/esphome/entity.rb', line 87

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



87
88
89
# File 'lib/esphome/entity.rb', line 87

def name
  @name
end

#object_id_Object (readonly)

Returns the value of attribute object_id_.



87
88
89
# File 'lib/esphome/entity.rb', line 87

def object_id_
  @object_id_
end

Instance Method Details

#inspectString

Returns:

  • (String)


107
108
109
110
111
112
113
114
115
# File 'lib/esphome/entity.rb', line 107

def inspect
  vars = inspection_vars.filter_map do |var|
    val = __send__(var)
    next if hideable?(var, val)

    "#{var}=#{val.inspect}"
  end
  "#<#{self.class.name} #{vars.join(", ")}>"
end