small bug fix

This commit is contained in:
Sami Samhuri 2014-12-23 09:55:41 -08:00
parent 2fa35e873a
commit d716976109

8
lights
View file

@ -57,15 +57,15 @@ else
temp: setting.to_i, temp: setting.to_i,
brightness: brightness.to_i, brightness: brightness.to_i,
} }
if transition
# tenths of a second
attrs[:transitiontime] = transition.to_i
end
if attrs if attrs
attrs[:bri] = attrs.delete(:brightness) attrs[:bri] = attrs.delete(:brightness)
if attrs[:temp] if attrs[:temp]
attrs[:ct] = kelvin_to_mireds(attrs.delete(:temp)) attrs[:ct] = kelvin_to_mireds(attrs.delete(:temp))
end end
if transition
# tenths of a second
attrs[:transitiontime] = transition.to_i
end
lights.each do |l| lights.each do |l|
l.send(:set!, attrs) l.send(:set!, attrs)
end end