From: Seyed Amir Hossein Aqajari Date: Sun, 11 Aug 2019 00:55:39 +0000 (-0700) Subject: Update turn-on-before-sunset.groovy X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartapps.git;a=commitdiff_plain;h=a4ac28f7ee2834beeb6df98c4da0f8728e07a881 Update turn-on-before-sunset.groovy --- diff --git a/official/turn-on-before-sunset.groovy b/official/turn-on-before-sunset.groovy index 1c8a5db..74bed7d 100644 --- a/official/turn-on-before-sunset.groovy +++ b/official/turn-on-before-sunset.groovy @@ -56,12 +56,12 @@ def scheduleTurnOn(sunsetString) { //def sunsetTime = Date.parse("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", sunsetString) //calculate the offset - //def timeBeforeSunset = new Date() + def timeBeforeSunset = new Date() - //log.debug "Scheduling for: $timeBeforeSunset" + log.debug "Scheduling for: $timeBeforeSunset" //schedule this to run one time - runOnce("someTime", turnOn) + runOnce(timeBeforeSunset, turnOn) } def turnOn() {