Update PhotonDS18B20.groovy

This commit is contained in:
timberjoegithub
2017-02-12 13:20:54 -05:00
committed by GitHub
parent 6584f70aae
commit 1b206ddfef
+5 -6
View File
@@ -74,13 +74,12 @@ private String parseName(String description) {
private String parseValue(String description) { private String parseValue(String description) {
if (description?.startsWith("temperature: ")) { if (description?.startsWith("temperature: ")) {
httpPost(
uri: "https://api.spark.io/v1/devices/${deviceId}/strelay${relaynum}",
body: [access_token: token, command: relaystate],
) {response -> log.debug (response.data)}
return zigbee.parseHATemperatureValue(description, "temperature: ", getTemperatureScale()) return zigbee.parseHATemperatureValue(description, "temperature: ", getTemperatureScale())
} else if (description?.startsWith("humidity: ")) { }
def pct = (description - "humidity: " - "%").trim()
if (pct.isNumber()) {
return Math.round(new BigDecimal(pct)).toString()
}
}
null null
} }
private put(relaystate) { private put(relaystate) {