From a541d05df9df00635151bcef1465fba78c7aa3cf Mon Sep 17 00:00:00 2001 From: Kelly Lu Date: Wed, 16 Jun 2021 12:13:26 -0700 Subject: [PATCH] Fixed dimmer functionality Contrary to what the SmartThings documentation says, the return value of `level` is `String` rather than `Integer`. This fixes the behavior where turning the dial doesn't change the brightness level of the bulb. --- smartapps/light-control-v0.10.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smartapps/light-control-v0.10.groovy b/smartapps/light-control-v0.10.groovy index 6211f8e..6e2952d 100644 --- a/smartapps/light-control-v0.10.groovy +++ b/smartapps/light-control-v0.10.groovy @@ -113,11 +113,11 @@ def handleCommand(command, value) { } } else { whiteBulbs.each { - Integer currentLevel = it.currentValue("level") + String currentLevel = it.currentValue("level") log.debug "Set level of White Spectrum bulb $currentLevel -> $value" } rgbBulbs.each { - Integer currentLevel = it.currentValue("level") + String currentLevel = it.currentValue("level") log.debug "Set level of RGB bulb $currentLevel -> $value" } whiteBulbs*.setLevel(value as Integer)