Skip to content

Commit

Permalink
fix null error on error_loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ethayer committed Nov 11, 2015
1 parent 7a02594 commit c743a38
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions user-lock-manager.smartapp.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* User Lock Manager v4.0.8
* User Lock Manager v4.0.9
*
* Copyright 2015 Erik Thayer
*
Expand Down Expand Up @@ -151,7 +151,6 @@ def notificationPage() {
section {
input(name: "phone", type: "phone", title: "Text This Number", description: "Phone number", required: false, submitOnChange: true)
input(name: "notification", type: "bool", title: "Send A Push Notification", description: "Notification", required: false, submitOnChange: true)
input(name: "sendevent", type: "bool", title: "Send An Event Notification", description: "Event Notification", required: false, submitOnChange: true)
if (phone != null || notification || sendevent) {
input(name: "notifyAccess", title: "on User Entry", type: "bool", required: false)
input(name: "notifyAccessStart", title: "when granting access", type: "bool", required: false)
Expand Down Expand Up @@ -1248,7 +1247,7 @@ def allCodesDone() {
def codeComplete = true
theLocks.each { lock->
i++
if (state."lock${i}".error_loop == true) {
if (state."lock${lock.id}".error_loop == true) {
codeComplete = false
}
}
Expand Down Expand Up @@ -1278,13 +1277,12 @@ private send(msg) {
private sendMessage(msg) {
if (notification) {
sendPush(msg)
} else {
sendNotificationEvent(msg)
}
if (phone) {
sendSms(phone, msg)
}
if (sendevent) {
sendNotificationEvent(msg)
}
}

def populateDiscovery(codeData, lock) {
Expand Down

0 comments on commit c743a38

Please sign in to comment.