Update turn-on-before-sunset.groovy
[smartapps.git] / official / turn-on-before-sunset.groovy
index a4ed25c..1c8a5db 100644 (file)
@@ -53,15 +53,15 @@ def sunsetTimeHandler(evt) {
 
 def scheduleTurnOn(sunsetString) {
     //get the Date value for the string
-    def sunsetTime = Date.parse("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", sunsetString)
+    //def sunsetTime = Date.parse("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", sunsetString)
 
     //calculate the offset
-    def timeBeforeSunset = new Date(sunsetTime.time - (offset * 60 * 1000))
+    //def timeBeforeSunset = new Date()
 
-    log.debug "Scheduling for: $timeBeforeSunset (sunset is $sunsetTime)"
+    //log.debug "Scheduling for: $timeBeforeSunset"
 
     //schedule this to run one time
-    runOnce(timeBeforeSunset, turnOn)
+    runOnce("someTime", turnOn)
 }
 
 def turnOn() {