Skip to content

Commit

Permalink
Merge pull request SmartThingsCommunity#148 from tslagle13/MSA-588-8
Browse files Browse the repository at this point in the history
Merged publication request 'Hello, Home Phrase Director'
  • Loading branch information
SmartThings committed Oct 13, 2015
2 parents 587b329 + 45f08df commit 30fdb92
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* Magic Home
*
* Copyright 2014 Tim Slagle
Expand Down Expand Up @@ -198,7 +198,7 @@

//set home mode when house is occupied
def setHome() {

sendOutOfDateNotification()
log.info("Setting Home Mode!!")
if(anyoneIsHome()) {
if(state.sunMode == "sunset"){
Expand Down Expand Up @@ -319,3 +319,14 @@
private hideOptionsSection() {
(starting || ending || days || modes) ? false : true
}

def sendOutOfDateNotification(){
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()
}
}

0 comments on commit 30fdb92

Please sign in to comment.