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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

majick
Copy link

@majick majick commented Jan 3, 2022

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 majick mentioned this pull request Jan 13, 2022
@majick
Copy link
Author

majick commented Jan 13, 2022

This addresses #10

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.

1 participant