Merge pull request #1507 from varzac/remove-deprecated-zonetype19

[DPROT-167] Remove calls to ZoneType19 methods
This commit is contained in:
Zach Varberg
2017-02-03 13:46:40 -06:00
committed by GitHub
6 changed files with 16 additions and 28 deletions

View File

@@ -40,14 +40,11 @@ metadata {
// Parse incoming device messages to generate events // Parse incoming device messages to generate events
def parse(String description) { def parse(String description) {
def name = null def resMap
def value = description if (description.startsWith("zone")) {
if (zigbee.isZoneType19(description)) { resMap = createEvent(name: "contact", value: zigbee.parseZoneStatus(description).isAlarm1Set() ? "open" : "closed")
name = "contact"
value = zigbee.translateStatusZoneType19(description) ? "open" : "closed"
} }
def result = createEvent(name: name, value: value) log.debug "Parse returned $resMap"
log.debug "Parse returned ${result?.descriptionText}" return resMap
return result
} }

View File

@@ -88,7 +88,7 @@ def parse(String description) {
log.debug "parse($description)" log.debug "parse($description)"
def results = [:] def results = [:]
if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) { if (!isSupportedDescription(description) || description.startsWith("zone")) {
// Ignore this in favor of orientation-based state // Ignore this in favor of orientation-based state
// results = parseSingleMessage(description) // results = parseSingleMessage(description)
} }

View File

@@ -117,7 +117,7 @@ def parse(String description) {
log.debug "parse($description)" log.debug "parse($description)"
def results = null def results = null
if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) { if (!isSupportedDescription(description) || description.startsWith("zone")) {
// Ignore this in favor of orientation-based state // Ignore this in favor of orientation-based state
// results = parseSingleMessage(description) // results = parseSingleMessage(description)
} }

View File

@@ -45,7 +45,7 @@ metadata {
def parse(String description) { def parse(String description) {
def results = [:] def results = [:]
if (isZoneType19(description) || !isSupportedDescription(description)) { if (description.startsWith("zone") || !isSupportedDescription(description)) {
results = parseBasicMessage(description) results = parseBasicMessage(description)
} }
else if (isMotionStatusMessage(description)){ else if (isMotionStatusMessage(description)){
@@ -87,16 +87,12 @@ private String parseName(String description) {
} }
private String parseValue(String description) { private String parseValue(String description) {
if (isZoneType19(description)) { def zs = zigbee.parseZoneStatus(description)
if (translateStatusZoneType19(description)) { if (zs) {
return "active" zs.isAlarm1Set() ? "active" : "inactive"
} } else {
else { description
return "inactive"
}
} }
description
} }
private parseDescriptionText(String linkText, String value, String description) { private parseDescriptionText(String linkText, String value, String description) {

View File

@@ -86,7 +86,7 @@ metadata {
def parse(String description) { def parse(String description) {
def results def results
if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) { if (!isSupportedDescription(description) || description.startsWith("zone")) {
results = parseSingleMessage(description) results = parseSingleMessage(description)
} }
else if (description == 'updated') { else if (description == 'updated') {
@@ -488,12 +488,7 @@ private String parseValue(String description) {
if (!isSupportedDescription(description)) { if (!isSupportedDescription(description)) {
return description return description
} }
else if (zigbee.translateStatusZoneType19(description)) { return zigbee.parseZoneStatus(description)?.isAlarm1Set() ? "open" : "closed"
return "open"
}
else {
return "closed"
}
} }
private parseDescriptionText(String linkText, String value, String description) { private parseDescriptionText(String linkText, String value, String description) {

View File

@@ -96,7 +96,7 @@ metadata {
def parse(String description) { def parse(String description) {
def results def results
if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) { if (!isSupportedDescription(description) || description.startsWith("zone")) {
// Ignore this in favor of orientation-based state // Ignore this in favor of orientation-based state
// results = parseSingleMessage(description) // results = parseSingleMessage(description)
} }