Update speaker-weather-forecast.groovy
[smartapps.git] / official / gentle-wake-up.groovy
index d4d0c7209d9c697127a8efcf1ff11283df318f15..3832d672738acb3679dd21f606449c7c52c09309 100755 (executable)
@@ -86,9 +86,6 @@ def unsupportedDevicesPage() {
                                        paragraph deviceLabel(it)
                                }
                        }
-                       /*section {
-                               input(name: "dimmers", type: "capability.sensor", title: "Please remove the above devices from this list.", submitOnChange: true, multiple: true)
-                       }*/
                        section {
                                paragraph "If you think there is a mistake here, please contact support."
                        }
@@ -279,6 +276,7 @@ def updated() {
 }
 
 private initialize() {
+       startLevel = 0//Chagne start level to 0 to make it possible for the light to be off!
        stop("settingsChange")
 
        if (startTime) {
@@ -532,7 +530,7 @@ private increment() {
                def runAgain = stepDuration()
                log.debug "Rescheduling to run again in ${runAgain} seconds"
 
-               runIn(runAgain, 'increment', [overwrite: true])
+               //runIn(runAgain, 'increment', [overwrite: true])
 
        } else {
 
@@ -606,9 +604,9 @@ private completion() {
 
        stop("schedule")
 
-       handleCompletionSwitches()
+       //handleCompletionSwitches()
 
-       handleCompletionMessaging()
+       //handleCompletionMessaging()
 
        handleCompletionModesAndPhrases()
 }
@@ -704,9 +702,9 @@ def canStartAutomatically() {
        def today = new Date().format("EEEE")
        log.debug "today: ${today}, days: ${days}"
 
-       if (!days || days.contains(today)) {// if no days, assume every day
+       //if (!days || days.contains(today)) {// if no days, assume every day
                return true
-       }
+       //}
 
        log.trace "should not run"
        return false
@@ -725,7 +723,9 @@ def completionPercentage() {
        def percentComplete = timeElapsed / totalRunTime * 100
        log.debug "percentComplete: ${percentComplete}"
 
-       return percentComplete
+       //return percentComplete
+       // We do not have the notion of time for model-checking
+       return 0
 }
 
 int totalRunTimeMillis() {