mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-04-03 06:13:06 +01:00
Properly handle tempOffset in smartsense sensors
This was accidentally dropped as a part of the zigbee DTH cleanup that was done a while ago. This properly adjusts according to the offset. This resolves: https://smartthings.atlassian.net/browse/DVCSMP-2516
This commit is contained in:
@@ -106,6 +106,12 @@ def parse(String description) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (map.name == "temperature") {
|
||||||
|
if (tempOffset) {
|
||||||
|
map.value = (int) map.value + (int) tempOffset
|
||||||
|
}
|
||||||
|
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
|
||||||
|
map.translatable = true
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug "Parse returned $map"
|
log.debug "Parse returned $map"
|
||||||
|
|||||||
@@ -112,6 +112,12 @@ def parse(String description) {
|
|||||||
map = getMotionResult(value)
|
map = getMotionResult(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (map.name == "temperature") {
|
||||||
|
if (tempOffset) {
|
||||||
|
map.value = (int) map.value + (int) tempOffset
|
||||||
|
}
|
||||||
|
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
|
||||||
|
map.translatable = true
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug "Parse returned $map"
|
log.debug "Parse returned $map"
|
||||||
|
|||||||
@@ -95,6 +95,12 @@ def parse(String description) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (map.name == "temperature") {
|
||||||
|
if (tempOffset) {
|
||||||
|
map.value = (int) map.value + (int) tempOffset
|
||||||
|
}
|
||||||
|
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
|
||||||
|
map.translatable = true
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug "Parse returned $map"
|
log.debug "Parse returned $map"
|
||||||
|
|||||||
@@ -88,6 +88,12 @@ def parse(String description) {
|
|||||||
log.warn "TEMP REPORTING CONFIG FAILED- error code: ${descMap.data[0]}"
|
log.warn "TEMP REPORTING CONFIG FAILED- error code: ${descMap.data[0]}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (map.name == "temperature") {
|
||||||
|
if (tempOffset) {
|
||||||
|
map.value = (int) map.value + (int) tempOffset
|
||||||
|
}
|
||||||
|
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
|
||||||
|
map.translatable = true
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug "Parse returned $map"
|
log.debug "Parse returned $map"
|
||||||
|
|||||||
Reference in New Issue
Block a user