hue-cli icon indicating copy to clipboard operation
hue-cli copied to clipboard

Fix crash when enumerating lights that don't have a brightness atrribute

Open majick opened this issue 3 years ago • 1 comments

Some devices do not have a brightness, such as switches:

$ hue 23 dump   # A switched outlet
{"on":true,"alert":"none","mode":"homeautomation","reachable":true}

$ hue 2 dump  # A light
{"on":false,"bri":76,"ct":367,"alert":"none","colormode":"ct","mode":"homeautomation","reachable":true}

$ hue | egrep '( 2\.|23\.)'
     2. D1 Bulb                          OFF     LTW011 - Color temperature light
    23. Fish Light                       ON      LXN56-0S27LX1.1 - On/Off light

This causes the hue lights command to crash when trying to access the brightness method. This small change prevents the crash and allows hue lights to continue.

majick avatar Jan 03 '22 18:01 majick

This addresses #10

majick avatar Jan 13 '22 02:01 majick