class Hue::Scene

Constants

SCENE_KEYS_MAP

Attributes

active[R]

Whether or not the scene is active on a group.

bridge[R]

Bridge the scene is associated with

id[R]

Unique identification number.

name[RW]

A unique, editable name given to the scene.

Public Class Methods

new(client, bridge, id, data) click to toggle source
# File lib/hue/scene.rb, line 18
def initialize(client, bridge, id, data)
  @client = client
  @bridge = bridge
  @id = id

  unpack(data)
end

Public Instance Methods

lights() click to toggle source
# File lib/hue/scene.rb, line 26
def lights
  @lights ||= begin
    @light_ids.map do |light_id|
      @client.light(light_id)
    end
  end
end

Private Instance Methods

base_url() click to toggle source
# File lib/hue/scene.rb, line 46
def base_url
  "http://#{@bridge.ip}/api/#{@client.username}/scenes/#{id}"
end
unpack(data) click to toggle source
# File lib/hue/scene.rb, line 42
def unpack(data)
  unpack_hash(data, SCENE_KEYS_MAP)
end