Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rolling down production commits to staging #39022

Merged
merged 4 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ private Map getTemperatureResult(value) {
def linkText = getLinkText(device)

if (tempOffset) {
def offset = tempOffset as int
def v = value as int
value = v + offset
value = new BigDecimal((value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
def descriptionText = "${linkText} is ${value}°${temperatureScale}"
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def parse(String description) {
} else if (map.name == "temperature") {
freezeStatus(map.value)
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
map.descriptionText = temperatureScale == 'C' ? "${device.displayName} was ${map.value}°C" : "${device.displayName} was ${map.value}°F"
map.translatable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def parse(String description) {
}
} else if (map.name == "temperature") {
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
map.translatable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def parse(String description) {
map = parseAttrMessage(description)
} else if (map.name == "temperature") {
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
map.descriptionText = temperatureScale == 'C' ? "${device.displayName} was ${map.value}°C" : "${device.displayName} was ${map.value}°F"
map.translatable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def parse(String description) {
}
} else if (map.name == "temperature") {
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
map.unit = getTemperatureScale()
}
map.descriptionText = getTemperatureScale() == 'C' ? "${ device.displayName } was ${ map.value }°C" : "${ device.displayName } was ${ map.value }°F"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,7 @@ private getTempResult(part, description) {
def temperatureScale = getTemperatureScale()
def value = zigbee.parseSmartThingsTemperatureValue(part, "temp: ", temperatureScale)
if (tempOffset) {
def offset = tempOffset as int
def v = value as int
value = v + offset
value = new BigDecimal((value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
def linkText = getLinkText(device)
def descriptionText = "$linkText was $value°$temperatureScale"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ private getTempResult(part, description) {
def temperatureScale = getTemperatureScale()
def value = zigbee.parseSmartThingsTemperatureValue(part, "temp: ", temperatureScale)
if (tempOffset) {
def offset = tempOffset as int
def v = value as int
value = v + offset
value = new BigDecimal((value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
def linkText = getLinkText(device)
def descriptionText = "$linkText was $value°$temperatureScale"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def parse(String description) {
}
} else if (map.name == "temperature") {
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
map.translatable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def parse(String description) {
}
} else if (map.name == "temperature") {
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
map.translatable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def parse(String description) {
} else if (maps[0].name == "temperature") {
def map = maps[0]
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
map.translatable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,7 @@ private Map getTempResult(part, description) {
def temperatureScale = getTemperatureScale()
def value = zigbee.parseSmartThingsTemperatureValue(part, "temp: ", temperatureScale)
if (tempOffset) {
def offset = tempOffset as int
def v = value as int
value = v + offset
value = new BigDecimal((value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
def linkText = getLinkText(device)
def descriptionText = "$linkText was $value°$temperatureScale"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def parse(String description) {
}
} else if (map.name == "temperature") {
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
map.translatable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def parse(String description) {
}
} else if (map.name == "temperature") {
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
map.translatable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ private getTempResult(part, description) {
def temperatureScale = getTemperatureScale()
def value = zigbee.parseSmartThingsTemperatureValue(part, "temp: ", temperatureScale)
if (tempOffset) {
def offset = tempOffset as int
def v = value as int
value = v + offset
value = new BigDecimal((value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
def linkText = getLinkText(device)
def descriptionText = "$linkText was $value°$temperatureScale"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ private Map getTemperatureResult(value) {
log.debug 'TEMP'
def linkText = getLinkText(device)
if (tempOffset) {
def offset = tempOffset as int
def v = value as int
value = v + offset
value = new BigDecimal((value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
def descriptionText = "${linkText} was ${value}°${temperatureScale}"
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def parse(String description) {
}
} else if (map.name == "temperature") {
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
map.descriptionText = temperatureScale == 'C' ? "${device.displayName} temperature was ${map.value}°C" : "${device.displayName} temperature was ${map.value}°F"
map.translatable = true
Expand Down Expand Up @@ -250,4 +250,4 @@ def configure() {
zigbee.configureReporting(zigbee.RELATIVE_HUMIDITY_CLUSTER, 0x0000, DataType.UINT16, 30, 3600, 100)

return refresh() + configCmds
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def parse(String description) {
}
} else if (map.name == "temperature") {
if (tempOffset) {
map.value = map.value + tempOffset
map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
}
map.descriptionText = temperatureScale == 'C' ? "${device.displayName} was ${map.value}°C" : "${device.displayName} was ${map.value}°F"
map.translatable = true
Expand Down Expand Up @@ -184,4 +184,4 @@ def configure() {

private boolean isZoneMessage(description) {
return (description?.startsWith('zone status') || description?.startsWith('zone report'))
}
}