Skip to content

Commit

Permalink
elimimate unlock error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ethayer committed Jun 7, 2015
1 parent 14d958f commit 867d42d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions user-lock-manager.smartapp.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,10 @@ def onUnlockPage() {
}

def resetCodeUsagePage(params) {
// do reset
resetCodeUsage(params.number)
def i = getUser(params)
// do reset
resetCodeUsage(i)

dynamicPage(name:"resetCodeUsagePage", title:"User Usage Reset") {
section {
paragraph "User code usage has been reset."
Expand Down Expand Up @@ -461,7 +462,6 @@ def updated() {
}

private initialize() {
log.debug "Settings: ${settings}"
unsubscribe()
unschedule()
if (startTime && !startDateTime()) {
Expand Down Expand Up @@ -803,10 +803,9 @@ def usedUserSlot(usedSlot) {
}

def codeUsed(evt) {
def codeData = new JsonSlurper().parseText(evt.data)
if(evt.value == "unlocked" && evt.data) {
codeData = new JsonSlurper().parseText(evt.data)
if(userSlotArray().contains(codeData.usedCode.toInteger())) {
def codeData = new JsonSlurper().parseText(evt.data)
if(codeData.usedCode && userSlotArray().contains(codeData.usedCode.toInteger())) {
def usedSlot = usedUserSlot(codeData.usedCode).toInteger()
def unlockUserName = settings."userName${usedSlot}"
def message = "${evt.displayName} was unlocked by ${unlockUserName}"
Expand Down

0 comments on commit 867d42d

Please sign in to comment.