Update medicine-management-temp-motion.groovy
authorRahmadi Trimananda <rahmadi.trimananda@uci.edu>
Tue, 13 Aug 2019 17:30:57 +0000 (10:30 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Tue, 13 Aug 2019 17:30:57 +0000 (10:30 -0700)
official/medicine-management-temp-motion.groovy

index a047306..5ba6c97 100755 (executable)
@@ -180,10 +180,11 @@ def resetLEDNotification(){
 
     // return color to original
     log.debug "Reset LED color to: $state.origColor"
-    deviceLight.setHue(state.origColor)
+    if (state.origColor != null)
+       deviceLight.setHue(state.origColor)
     
     // if the light was turned on just for the notification, turn it back off now
     if (state.ledState == "off") {
        deviceLight.off()
     }
-}
\ No newline at end of file
+}