Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
krlaframboise committed Aug 4, 2017
1 parent 07b81c5 commit 022f70e
Showing 1 changed file with 34 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ metadata {
simulator { }

preferences {
getOptionsInput(ledIndicatorParam)
getOptionsInput(openClosedReportingParam)
getOptionsInput(tempReportingParam)
getOptionsInput(tempOffsetParam)
getOptionsInput(tempUnitsParam)
configParams.each {
getOptionsInput(it)
}

getOptionsInput("checkinInterval", "Checkin Interval", checkinIntervalSetting, wakeUpIntervalOptions)

Expand Down Expand Up @@ -98,7 +96,7 @@ metadata {
}

valueTile("battery", "device.battery", inactiveLabel: false, width: 2, height: 2, decoration: "flat") {
state "battery", label:'${currentValue}% battery', unit:""
state "battery", label:'${currentValue}% Battery', unit:""
}

standardTile("refresh", "device.refresh", width: 2, height: 2) {
Expand Down Expand Up @@ -137,12 +135,14 @@ private getOptionsInput(name, title, defaultVal, options) {
}

private getOptionsInput(param) {
input "${param.prefName}", "enum",
title: "${param.name}:",
defaultValue: "${param.val}",
required: false,
displayDuringSetup: true,
options: param.options?.collect { name, val -> name }
if (param?.prefName) {
input "${param.prefName}", "enum",
title: "${param.name}:",
defaultValue: "${param.val}",
required: false,
displayDuringSetup: true,
options: param.options?.collect { name, val -> name }
}
}

def updated() {
Expand Down Expand Up @@ -395,20 +395,33 @@ def zwaveEvent(physicalgraph.zwave.commands.sensorbinaryv2.SensorBinaryReport cm
return []
}

def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cmd) {
logTrace "NotificationReport: $cmd"
sendLastCheckinEvent()

def zwaveEvent(physicalgraph.zwave.commands.alarmv2.AlarmReport cmd) {
logTrace "AlarmReport[zwaveAlarmEvent: $cmd.zwaveAlarmEvent, zwaveAlarmType: $cmd.zwaveAlarmType]"
def result = []
if (cmd.notificationType == 0x06) {
result += handleContactEvent(cmd.event)
if (cmd.zwaveAlarmType == 0x06) {
result += handleContactEvent(cmd.zwaveAlarmEvent)
}
else if (cmd.notificationType == 0x07) {
result += handleTamperEvent(cmd.event)
else if (cmd.zwaveAlarmType == 0x07) {
result += handleTamperEvent(cmd.zwaveAlarmEvent)
}
return result
}

// def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cmd) {
// logTrace "NotificationReport[event: $cmd.event, notificationType: $cmd.notificationType]"

// sendLastCheckinEvent()

// def result = []
// if (cmd.notificationType == 0x06) {
// result += handleContactEvent(cmd.event)
// }
// else if (cmd.notificationType == 0x07) {
// result += handleTamperEvent(cmd.event)
// }
// return result
// }

private handleContactEvent(event) {
def result = []
def val = (event == 0xFF || event == 0x16) ? "open" : "closed"
Expand Down Expand Up @@ -487,7 +500,7 @@ private getCommandClassVersions() {
0x5A: 1, // DeviceResetLocally
0x5E: 2, // ZwaveplusInfo
0x70: 2, // Configuration (v1)
0x71: 3, // Notification (v4)
0x71: 2, // Notification (v4)
0x72: 2, // ManufacturerSpecific
0x73: 1, // Powerlevel
0x7A: 2, // FirmwareUpdateMd
Expand Down

0 comments on commit 022f70e

Please sign in to comment.