Skip to content

Commit 30fdb92

Browse files
committed
Merge pull request SmartThingsCommunity#148 from tslagle13/MSA-588-8
Merged publication request 'Hello, Home Phrase Director'
2 parents 587b329 + 45f08df commit 30fdb92

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

smartapps/tslagle13/hello-home-phrase-director.src/hello-home-phrase-director.groovy

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/**
22
* Magic Home
33
*
44
* Copyright 2014 Tim Slagle
@@ -198,7 +198,7 @@
198198

199199
//set home mode when house is occupied
200200
def setHome() {
201-
201+
sendOutOfDateNotification()
202202
log.info("Setting Home Mode!!")
203203
if(anyoneIsHome()) {
204204
if(state.sunMode == "sunset"){
@@ -319,3 +319,14 @@
319319
private hideOptionsSection() {
320320
(starting || ending || days || modes) ? false : true
321321
}
322+
323+
def sendOutOfDateNotification(){
324+
if(!state.lastTime){
325+
state.lastTime = (new Date() + 31).getTime()
326+
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.")
327+
}
328+
else if (((new Date()).getTime()) >= state.lastTime){
329+
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.")
330+
state.lastTime = (new Date() + 31).getTime()
331+
}
332+
}

0 commit comments

Comments
 (0)