Skip to content

Commit

Permalink
global notification settings fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ethayer committed May 16, 2017
1 parent 3b57a9a commit e19966d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion smartapps/ethayer/keypad.src/keypad.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def mainPage() {
section('Setup', hideable: true, hidden: true) {
input(name: 'keypad', title: 'Keypad', type: 'capability.lockCodes', multiple: false, required: true)
label title: 'Label', defaultValue: "Keypad: ${keypad.label}", required: false, description: 'recommended to start with Keypad:'
paragraph 'Lock Manager © 2017 v1.3'
paragraph 'Lock Manager © 2017 v1.4'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion smartapps/ethayer/lock-manager.src/lock-manager.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def mainPage() {
section('Advanced', hideable: true, hidden: true) {
input(name: 'overwriteMode', title: 'Overwrite?', type: 'bool', required: true, defaultValue: true, description: 'Overwrite mode automatically deletes codes not in the users list')
input(name: 'enableDebug', title: 'Enable IDE debug messages?', type: 'bool', required: true, defaultValue: false, description: 'Show activity from Lock Manger in logs for debugging.')
paragraph 'Lock Manager © 2017 v1.3'
paragraph 'Lock Manager © 2017 v1.4'
}
}
}
Expand Down
28 changes: 14 additions & 14 deletions smartapps/ethayer/lock-user.src/lock-user.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def mainPage() {
label(title: "Name for App", defaultValue: 'User: ' + userName, required: true, image: 'https://dl.dropboxusercontent.com/u/54190708/LockManager/user.png')
input name: 'userName', title: "Name for user", required: true, image: 'https://dl.dropboxusercontent.com/u/54190708/LockManager/user.png'
input(name: "userSlot", type: "enum", options: parent.availableSlots(settings.userSlot), title: "Select slot", required: true, refreshAfterSelection: true )
paragraph 'Lock Manager © 2017 v1.3'
paragraph 'Lock Manager © 2017 v1.4'
}
}
}
Expand Down Expand Up @@ -800,12 +800,12 @@ def getLock(params) {
}

def userNotificationSettings() {
def userSettings = false
if (phone != null || notification || muteUser || recipients) {
// user has it's own settings!
return true
userSettings = true
}
// user doesn't !
return false
return userSettings
}

def send(msg) {
Expand Down Expand Up @@ -834,7 +834,7 @@ def checkIfNotifyGlobal(msg) {
def start = timeToday(parent.notificationStartTime)
def stop = timeToday(parent.notificationEndTime)
def now = new Date()
if (parent.start.before(now) && parent.stop.after(now)){
if (start.before(now) && stop.after(now)){
sendMessageViaParent(msg)
}
} else {
Expand All @@ -852,14 +852,14 @@ def sendMessageViaParent(msg) {
sendNotificationEvent(msg)
}
if (parent.phone) {
if ( phone.indexOf(";") > 1){
if ( parent.phone.indexOf(";") > 1){
def phones = parent.phone.split(";")
for ( def i = 0; i < phones.size(); i++) {
sendSms(phones[i], msg)
}
}
else {
sendSms(phone, msg)
sendSms(parent.phone, msg)
}
}
}
Expand Down Expand Up @@ -962,13 +962,6 @@ def sendAskAlexa(message) {
unit: "User//${userName}")
}

def debugger(message) {
def doDebugger = parent.debuggerOn()
if (doDebugger) {
log.debug(message)
}
}

private anyoneHome(sensors) {
def result = false
if(sensors.findAll { it?.currentPresence == "present" }) {
Expand All @@ -994,3 +987,10 @@ def executeHelloPresenceCheck(routines) {
location.helloHome.execute(routines)
}
}

def debugger(message) {
def doDebugger = parent.debuggerOn()
if (doDebugger) {
log.debug(message)
}
}
2 changes: 1 addition & 1 deletion smartapps/ethayer/lock.src/lock.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def mainPage() {
} else {
paragraph 'Lock is loading data'
}
paragraph 'Lock Manager © 2017 v1.3'
paragraph 'Lock Manager © 2017 v1.4'
}
}
}
Expand Down

0 comments on commit e19966d

Please sign in to comment.