Skip to content

Commit 1ff3865

Browse files
authored
Update milight-light.groovy
1 parent bac184d commit 1ff3865

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

smartapps/fireboy1919/milight-light.src/milight-light.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def switchLevelHandler(evt) {
158158
def switchColorHandler(evt) {
159159
// Adapted from HA Bridge.
160160
log.debug("Hue: " + evt.value)
161-
def val = (int)((256 + 26 - Math.floor((Float.parseFloat(evt.value) / 100)* 255)) % 256);
161+
def val = (int)((360 + Math.floor((Float.parseFloat(evt.value) / 100)* 360)) % 360)
162162
def body = ["hue": val.toString() ]
163163

164164
if(parent.parent.settings.isDebug) { log.debug "color set! ${settings.code} / ${evt.device.name} / ${evt.value}" }
@@ -194,4 +194,4 @@ def httpCall(body, ipAddress, code, device) {
194194
} catch (e) {
195195
log.error "Error sending: $e"
196196
}
197-
}
197+
}

0 commit comments

Comments
 (0)