Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3202 from tobiaswegner/master
Browse files Browse the repository at this point in the history
Add support for 'On/Off plug-in unit' in hue binding
  • Loading branch information
teichsta committed Oct 8, 2015
2 parents a1504a0 + 730d241 commit 8bc758d
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -182,9 +182,13 @@ public int getBrightness(String deviceId) {
logger.error("Hue bridge settings not initialized correctly.");
return 0;
}
return (Integer) settingsData.node("lights")
.node(deviceId).node("state")
.value("bri");
Object bri = settingsData.node("lights").node(deviceId).node("state").value("bri");
if(bri instanceof Integer) {
return (Integer) bri;
} else {
//probably not dimmable, return on state
return isBulbOn(deviceId)?254:0;
}
}

/**
Expand Down

0 comments on commit 8bc758d

Please sign in to comment.