Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix setter of light.saturation and light.brightness #9

Merged
merged 1 commit into from Oct 10, 2013

Conversation

shokai
Copy link
Contributor

@shokai shokai commented Oct 10, 2013

Hi, thank you for a great gem.

I have found a bug and fixed it.

bug

following code sets random values to hue, but saturation and brightness are not worked.

require 'hue'

hue = Hue::Client.new
hue.lights.each do |light|
  light.on = true
end

loop do
  hue.lights.each do |light|
    puts light.name
    light.hue = rand 65535
    light.saturation = rand 255  ## not work
    light.brightness = rand 255  ## not work
  end
  sleep 0.1
end

they got error messages from hue bridge.

"[{\"error\":{\"type\":6,\"address\":\"/lights/1/state/brightness\",\"description\":\"parameter, brightness, not available\"}}]"
"[{\"error\":{\"type\":6,\"address\":\"/lights/2/state/saturation\",\"description\":\"parameter, saturation, not available\"}}]"

fixed

use STATE_KEYS_MAP instead of KEYS_MAP in translate_keys function.

soffes added a commit that referenced this pull request Oct 10, 2013
bugfix setter of light.saturation and light.brightness
@soffes soffes merged commit 6a6e1cd into soffes:master Oct 10, 2013
@shokai
Copy link
Contributor Author

shokai commented Oct 31, 2013

could you push to rubygems.org?

@soffes
Copy link
Owner

soffes commented Oct 31, 2013

Released version 0.1.2!

@shokai shokai deleted the bugfix_saturation_brightness branch August 30, 2014 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants