Class: NLHue::Light
Overview
A class representing a light known to a Hue bridge. Recommended use is to get a Light object by calling NLHue::Bridge#lights().
Instance Attribute Summary
Attributes inherited from Target
#bridge, #id, #name, #transitiontime, #type
Instance Method Summary collapse
-
#initialize(bridge, id, info = nil) ⇒ Light
constructor
bridge - The Bridge that controls this light.
-
#to_s ⇒ Object
“Light: [ID]: [name] ([type])”.
Methods inherited from Target
#alert, #alert!, #alert=, #bri, #bri=, #clear_alert, #colormode, #ct, #ct=, #defer, #effect, #effect=, #handle_json, #hue, #hue=, #nodefer, #off!, #on!, #on=, #on?, #sat, #sat=, #send_changes, #state, #submit, #to_h, #to_json, #update, #x, #x=, #xy, #xy=, #y, #y=
Constructor Details
#initialize(bridge, id, info = nil) ⇒ Light
bridge - The Bridge that controls this light. id - The bulb number. info - Parsed Hash of the JSON light info object from the bridge.
11 12 13 |
# File 'lib/nlhue/light.rb', line 11 def initialize(bridge, id, info=nil) super bridge, id, info, :lights, 'state' end |
Instance Method Details
#to_s ⇒ Object
“Light: [ID]: [name] ([type])”
16 17 18 |
# File 'lib/nlhue/light.rb', line 16 def to_s "Light: #{@id}: #{@name} (#{@type})" end |