Update gentle-wake-up.groovy
[smartapps.git] / official / bright-when-dark-and-or-bright-after-sunset.groovy
index f105423921f388df00f0c39969d05825cb15ad95..a8f8dafefdee66c1f5696401fae951783edfbf94 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)"