mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-05-08 22:06:57 +01:00
Wattvision updates from production
This commit is contained in:
@@ -348,16 +348,18 @@ private getSensorJSON(id, key) {
|
|||||||
|
|
||||||
httpGet(uri: sensorUrl) { response ->
|
httpGet(uri: sensorUrl) { response ->
|
||||||
|
|
||||||
def json = new org.json.JSONObject(response.data)
|
def sensors = [:]
|
||||||
|
|
||||||
state.sensors = json
|
response.data.each { sensorId, sensorName ->
|
||||||
|
sensors[sensorId] = sensorName
|
||||||
json.each { sensorId, sensorName ->
|
|
||||||
createChild(sensorId, sensorName)
|
createChild(sensorId, sensorName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state.sensors = sensors
|
||||||
|
|
||||||
return "success"
|
return "success"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def createChild(sensorId, sensorName) {
|
def createChild(sensorId, sensorName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user