Class: Hue::Scene
- Inherits:
-
Object
- Object
- Hue::Scene
- Includes:
- Enumerable, TranslateKeys
- Defined in:
- lib/hue/scene.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Whether or not the scene is active on a group.
-
#bridge ⇒ Object
readonly
Bridge the scene is associated with.
-
#id ⇒ Object
readonly
Unique identification number.
-
#name ⇒ Object
A unique, editable name given to the scene.
Instance Method Summary collapse
-
#initialize(client, bridge, id, data) ⇒ Scene
constructor
A new instance of Scene.
- #lights ⇒ Object
Methods included from TranslateKeys
Constructor Details
#initialize(client, bridge, id, data) ⇒ Scene
Returns a new instance of Scene.
18 19 20 21 22 23 24 |
# File 'lib/hue/scene.rb', line 18 def initialize(client, bridge, id, data) @client = client @bridge = bridge @id = id unpack(data) end |
Instance Attribute Details
#active ⇒ Object (readonly)
Whether or not the scene is active on a group.
16 17 18 |
# File 'lib/hue/scene.rb', line 16 def active @active end |
#bridge ⇒ Object (readonly)
Bridge the scene is associated with
10 11 12 |
# File 'lib/hue/scene.rb', line 10 def bridge @bridge end |
#id ⇒ Object (readonly)
Unique identification number.
7 8 9 |
# File 'lib/hue/scene.rb', line 7 def id @id end |
#name ⇒ Object
A unique, editable name given to the scene.
13 14 15 |
# File 'lib/hue/scene.rb', line 13 def name @name end |
Instance Method Details
#lights ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/hue/scene.rb', line 26 def lights @lights ||= begin @light_ids.map do |light_id| @client.light(light_id) end end end |