mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-08 05:31:56 +00:00
Wattvision updates from production
This commit is contained in:
@@ -346,18 +346,20 @@ private getSensorJSON(id, key) {
|
||||
|
||||
def sensorUrl = "${wattvisionBaseURL()}/partners/smartthings/sensor_list?api_id=${id}&api_key=${key}"
|
||||
|
||||
httpGet(uri: sensorUrl) { response ->
|
||||
httpGet(uri: sensorUrl) { response ->
|
||||
|
||||
def json = new org.json.JSONObject(response.data)
|
||||
def sensors = [:]
|
||||
|
||||
state.sensors = json
|
||||
|
||||
json.each { sensorId, sensorName ->
|
||||
response.data.each { sensorId, sensorName ->
|
||||
sensors[sensorId] = sensorName
|
||||
createChild(sensorId, sensorName)
|
||||
}
|
||||
}
|
||||
|
||||
state.sensors = sensors
|
||||
|
||||
return "success"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
def createChild(sensorId, sensorName) {
|
||||
|
||||
Reference in New Issue
Block a user