class Group
Attributes
detail[R]
lights[R]
name[R]
on[R]
Public Class Methods
new(key, hashvalue)
click to toggle source
Calls superclass method
HueResource::new
# File lib/ha/group.rb, line 4 def initialize(key, hashvalue) super @lights = hashvalue["lights"] @lights_s = hashvalue["lights"].join(",") gen_reskey("g") @state.merge! ({"on" =>@lights_s, "name" => @name, "detail" => @detail}) end
owning(number, grouparray)
click to toggle source
# File lib/ha/group.rb, line 16 def self.owning(number, grouparray) grouparray.select { |group| group.lights.include? number} end
Public Instance Methods
array(selectors)
click to toggle source
# File lib/ha/group.rb, line 12 def array(selectors) selectors.map { |key| @state[key] } end