Update turn-on-before-sunset.groovy
authorSeyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Wed, 7 Aug 2019 01:34:11 +0000 (18:34 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Wed, 7 Aug 2019 01:34:11 +0000 (18:34 -0700)
official/turn-on-before-sunset.groovy

index a4ed25c477bccc424a44f98fdd6f370588e8a432..74bed7d0be6a2dff8d3a5d893e8db51fd459c423 100644 (file)
@@ -53,12 +53,12 @@ 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)