Class: MQTT::Homie::Node
Instance Method Summary
collapse
Methods inherited from HomieObject
#initialize, #topic
included
Instance Method Details
#homie_attributes ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/mqtt/homie/node.rb', line 13
def homie_attributes
data = super
@properties.each do |p|
p.homie_attributes.each do |k, v|
data[p.topic + "/" + k] = v
end
data[p.topic] = p.value
end
data
end
|
#property(id) ⇒ Object
9
10
11
|
# File 'lib/mqtt/homie/node.rb', line 9
def property(id)
@properties.find { |i| i.id == id }
end
|