X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=official%2Fturn-on-before-sunset.groovy;h=1c8a5db1bf1e1cc0933be44715659aa7b1437e58;hb=80f62f1335e20b69b02fe82e18ffdafdbd658a58;hp=a4ed25c477bccc424a44f98fdd6f370588e8a432;hpb=ab9d735cfdc383797e7a6807cf18882c6066f6c0;p=smartapps.git diff --git a/official/turn-on-before-sunset.groovy b/official/turn-on-before-sunset.groovy index a4ed25c..1c8a5db 100644 --- a/official/turn-on-before-sunset.groovy +++ b/official/turn-on-before-sunset.groovy @@ -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() {