Update bright-when-dark-and-or-bright-after-sunset.groovy
authorSeyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Mon, 5 Aug 2019 22:43:23 +0000 (15:43 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Mon, 5 Aug 2019 22:43:23 +0000 (15:43 -0700)
official/bright-when-dark-and-or-bright-after-sunset.groovy

index f105423..a8f8daf 100755 (executable)
@@ -4,6 +4,7 @@ definition(
     author: "Arnaud",
     description: "Turn ON light(s) and/or dimmer(s) when there's movement and the room is dark with illuminance threshold and/or between sunset and sunrise. Then turn OFF after X minute(s) when the brightness of the room is above the illuminance threshold or turn OFF after X minute(s) when there is no movement.",
     category: "Convenience",
+    iconUrl: "http://neiloseman.com/wp-content/uploads/2013/08/stockvault-bulb128619.jpg",
     iconX2Url: "http://neiloseman.com/wp-content/uploads/2013/08/stockvault-bulb128619.jpg"
 )
 
@@ -20,6 +21,8 @@ preferences
        
        page(name: "configurations")
        page(name: "options")
+
+       
 }
 
 def configurations()
@@ -82,7 +85,7 @@ def options()
                                }
                        section ("Zip code (optional, defaults to location coordinates when location services are enabled)...")
                        {
-                               input "zipCode", "text", title: "Zip Code?", required: false, description: "Local Zip Code"
+                               input "zipCodeText", "text", title: "Zip Code?", required: false, description: "Local Zip Code"
                                }
                        }
                }
@@ -144,7 +147,7 @@ def options()
                                }
                        section ("Zip code (optional, defaults to location coordinates when location services are enabled)...")
                        {
-                               input "zipCode", "text", title: "Zip Code?", required: false, description: "Local Zip Code"
+                               input "zipCodeText", "text", title: "Zip Code?", required: false, description: "Local Zip Code"
                                }
                        }
                }
@@ -656,7 +659,7 @@ def turnOffDimmers()
 
 def astroCheck()
 {
-       def s = getSunriseAndSunset(zipCode: zipCode, sunriseOffset: sunriseOffset, sunsetOffset: sunsetOffset)
+       def s = getSunriseAndSunset(zipCode: zipCodeText, sunriseOffset: sunriseOffset, sunsetOffset: sunsetOffset)
        state.riseTime = s.sunrise.time
        state.setTime = s.sunset.time
        log.debug "Sunrise: ${new Date(state.riseTime)}($state.riseTime), Sunset: ${new Date(state.setTime)}($state.setTime)"