Class: MQTT::Homie::Property
- Inherits:
-
HomieObject
- Object
- HomieObject
- MQTT::Homie::Property
- Includes:
- Observable
- Defined in:
- lib/mqtt/homie/property.rb
Constant Summary collapse
- DATA_TYPES =
[:integer, :float, :boolean, :string, :enum, :color]
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Property
constructor
A new instance of Property.
- #settable? ⇒ Boolean
Methods inherited from HomieObject
Methods included from HomieAttribute
Constructor Details
#initialize(options = {}) ⇒ Property
Returns a new instance of Property.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mqtt/homie/property.rb', line 20 def initialize( = {}) = .dup # enum shortcut if enum = .delete(:enum) [:datatype] = :enum [:format] = enum.collect { |i| i.to_s }.join(",") end super() @value = [:value] end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
18 19 20 |
# File 'lib/mqtt/homie/property.rb', line 18 def value @value end |
Instance Method Details
#settable? ⇒ Boolean
43 44 45 |
# File 'lib/mqtt/homie/property.rb', line 43 def settable? @settable end |