bradyaturner / lights

A Ruby library & CLI for interacting with Philips Hue
MIT License
37 stars 7 forks source link

Handle lights with 'reachable'=false #70

Closed bradyaturner closed 9 years ago

bradyaturner commented 9 years ago

When lights are unreachable, bridge responds with all zero values for state variables:

"state": {
  "on": false,
  "bri": 0,
  "hue": 0,
  "sat": 0,
  "effect": "none",
  "xy": [
    0.0,
    0.0
  ],
  "ct": 0,
  "alert": "none",
  "colormode": "hs",
  "reachable": false
}

This was triggering the bounds checking code. Since the light is unreachable, we really don't know its state, so I'm skipping importing these values to avoid having out of range errors.

bradyaturner commented 9 years ago

This required an update to the simpletable gem: https://github.com/turnerba/simpletable/pull/6