mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-17 13:10:52 +00:00
MSA-588: Update to HHFD
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* Magic Home
|
* Magic Home
|
||||||
*
|
*
|
||||||
* Copyright 2014 Tim Slagle
|
* Copyright 2014 Tim Slagle
|
||||||
@@ -85,6 +85,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
def initialize() {
|
def initialize() {
|
||||||
|
state.clear()
|
||||||
subscribe(people, "presence", presence)
|
subscribe(people, "presence", presence)
|
||||||
runIn(60, checkSun)
|
runIn(60, checkSun)
|
||||||
subscribe(location, "sunrise", setSunrise)
|
subscribe(location, "sunrise", setSunrise)
|
||||||
@@ -198,7 +199,7 @@
|
|||||||
|
|
||||||
//set home mode when house is occupied
|
//set home mode when house is occupied
|
||||||
def setHome() {
|
def setHome() {
|
||||||
|
sendOutOfDateNotification()
|
||||||
log.info("Setting Home Mode!!")
|
log.info("Setting Home Mode!!")
|
||||||
if(anyoneIsHome()) {
|
if(anyoneIsHome()) {
|
||||||
if(state.sunMode == "sunset"){
|
if(state.sunMode == "sunset"){
|
||||||
@@ -319,3 +320,14 @@
|
|||||||
private hideOptionsSection() {
|
private hideOptionsSection() {
|
||||||
(starting || ending || days || modes) ? false : true
|
(starting || ending || days || modes) ? false : true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def sendOutOfDateNotification(evt){
|
||||||
|
if(!state.lastTime){
|
||||||
|
state.lastTime = (new Date() + 31).getTime()
|
||||||
|
sendNotification("Your version of Hello, Home Phrase Director is currently out of date. Please look for the new version of Hello, Home Phrase Director now called 'Routine Director' in the marketplace.")
|
||||||
|
}
|
||||||
|
else if (((new Date()).getTime()) >= state.lastTime){
|
||||||
|
sendNotification("Your version of Hello, Home Phrase Director is currently out of date. Please look for the new version of Hello, Home Phrase Director now called 'Routine Director' in the marketplace.")
|
||||||
|
state.lastTime = (new Date() + 31).getTime()
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user