Skip to content

Commit

Permalink
Update zwave-lock-schlage.groovy
Browse files Browse the repository at this point in the history
Added working logic for the pin length. Should be able to correctly set a lock pin length now.
  • Loading branch information
phantasm22 authored Feb 13, 2022
1 parent 27c800e commit 91efb8a
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,14 @@ def processSchlageLockConfig(cmd) {

break

case 0xB:
// done: lock specific alarm disable - local controls
case 0xB:
map = parseBinaryConfigRpt('localControl', cmd.configurationValue[0], 'Local Alarm Control')
break
if (cmd.configurationValue[0] == 0) {
isEnabled = 'Disabled'
}
sendEvent(name: 'localControl', value: isEnabled, displayed: false )
break

// how many times has the electric motor locked or unlock the device?
case 0xC:
Expand Down Expand Up @@ -2030,8 +2035,16 @@ def configureLocalControl() {
return onOffSequence(0x0B, localControl)
}
def configurePinLength() {
if (pinLength) {
return secureSequence([zwave.configurationV2.configurationSet(parameterNumber: 0x10, size: 1, configurationValue: [pinLength])],5000)
if (pinLength == 4) {
return secureSequence([zwave.configurationV2.configurationSet(parameterNumber: 0x10, size: 1, configurationValue: 0x04)],5000)
} else if (pinLength == 5) {
return secureSequence([zwave.configurationV2.configurationSet(parameterNumber: 0x10, size: 1, configurationValue: 0x05)],5000)
} else if (pinLength == 6) {
return secureSequence([zwave.configurationV2.configurationSet(parameterNumber: 0x10, size: 1, configurationValue: 0x06)],5000)
} else if (pinLength == 7) {
return secureSequence([zwave.configurationV2.configurationSet(parameterNumber: 0x10, size: 1, configurationValue: 0x07)],5000)
} else if (pinLength == 8) {
return secureSequence([zwave.configurationV2.configurationSet(parameterNumber: 0x10, size: 1, configurationValue: 0x08)],5000)
} else {
return null
}
Expand Down

0 comments on commit 91efb8a

Please sign in to comment.