Skip to content

Commit

Permalink
Wattvision updates from production
Browse files Browse the repository at this point in the history
  • Loading branch information
bflorian committed Sep 9, 2015
1 parent 76f0561 commit c00fbd3
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c00fbd3

Please sign in to comment.