DVCSMP-1615 Hue setColor throws exceptions when missing parameters

-DVCSMP-1637 Color picker set the light on but status not updated on the detail page
-DVCSMP-1638 Temperature control selection set the light on but status not updated on the detail page
-Added a lot of error checking for input parameters
-Fixed some data parsing exceptions
This commit is contained in:
Lars Finander
2016-03-23 12:25:40 -07:00
parent 1e27dc1824
commit ffd0dd1545
3 changed files with 123 additions and 54 deletions

View File

@@ -79,8 +79,12 @@ void off() {
void setLevel(percent) {
log.debug "Executing 'setLevel'"
parent.setLevel(this, percent)
sendEvent(name: "level", value: percent)
if (percent != null && percent >= 0 && percent <= 100) {
parent.setLevel(this, percent)
sendEvent(name: "level", value: percent)
} else {
log.warn "$percent is not 0-100"
}
}
void refresh() {