Class: Sensor
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#manufacturer_name ⇒ Object
readonly
Returns the value of attribute manufacturer_name.
-
#model_id ⇒ Object
readonly
Returns the value of attribute model_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#sw_version ⇒ Object
readonly
Returns the value of attribute sw_version.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#unique_id ⇒ Object
readonly
Returns the value of attribute unique_id.
Instance Method Summary collapse
-
#initialize(id, data = {}) ⇒ Sensor
constructor
A new instance of Sensor.
Methods inherited from HObject
Constructor Details
#initialize(id, data = {}) ⇒ Sensor
Returns a new instance of Sensor.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/lights/sensor.rb', line 22 def initialize( id, data = {} ) @id = id @name = data["name"] @type = data["type"] @model_id = data["modelid"] @manufacturer_name = data["manufacturername"] @unique_id = data["uniqueid"] @sw_version = data["swversion"] @config = data["config"] @state = SensorState.new(data["state"]) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
19 20 21 |
# File 'lib/lights/sensor.rb', line 19 def data @data end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
19 20 21 |
# File 'lib/lights/sensor.rb', line 19 def id @id end |
#manufacturer_name ⇒ Object (readonly)
Returns the value of attribute manufacturer_name.
19 20 21 |
# File 'lib/lights/sensor.rb', line 19 def manufacturer_name @manufacturer_name end |
#model_id ⇒ Object (readonly)
Returns the value of attribute model_id.
19 20 21 |
# File 'lib/lights/sensor.rb', line 19 def model_id @model_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
19 20 21 |
# File 'lib/lights/sensor.rb', line 19 def name @name end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
19 20 21 |
# File 'lib/lights/sensor.rb', line 19 def state @state end |
#sw_version ⇒ Object (readonly)
Returns the value of attribute sw_version.
19 20 21 |
# File 'lib/lights/sensor.rb', line 19 def sw_version @sw_version end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
19 20 21 |
# File 'lib/lights/sensor.rb', line 19 def type @type end |
#unique_id ⇒ Object (readonly)
Returns the value of attribute unique_id.
19 20 21 |
# File 'lib/lights/sensor.rb', line 19 def unique_id @unique_id end |