Skip to content

Instantly share code, notes, and snippets.

@davidsulpy
Last active October 30, 2015 20:10
Show Gist options
  • Save davidsulpy/81eae1ab4426c1ea73f8 to your computer and use it in GitHub Desktop.
Save davidsulpy/81eae1ab4426c1ea73f8 to your computer and use it in GitHub Desktop.
Flowthings Drop
{
"sensor": {
"type": "map",
"value": {
"luminiscence": {
"type": "integer",
"value": 77
},
"ultraviolet": {
"type": "integer",
"value": 0
},
"temperature": {
"type": "float",
"value": 25.6
},
"humidity": {
"type": "integer",
"value": 47
}
}
},
"water": {
"type": "boolean",
"value": false
},
"switch": {
"type": "map",
"value": {
"led-color": {
"type": "map",
"value": {
"red": {
"type": "integer",
"value": 27
},
"green": {
"type": "integer",
"value": 20
},
"blue": {
"type": "integer",
"value": 27
}
}
},
"power": {
"type": "map",
"value": {
"volts": {
"type": "float",
"value": 120.311005
},
"amps": {
"type": "integer",
"value": 0
},
"watts": {
"type": "integer",
"value": 0
}
}
},
"switch": {
"type": "boolean",
"value": true
}
}
}
}
var bodyJS = [
{ key: "Smart Sensor (luminiscence)", value: drop.elems.sensor.value.luminiscence.value },
{ key: "Smart Sensor (ultraviolet)", value: drop.elems.sensor.value.ultraviolet.value },
{ key: "Smart Sensor (temperature)", value: drop.elems.sensor.value.temperature.value },
{ key: "Smart Sensor (humidity)", value: drop.elems.sensor.value.humidity.value }
];
return JSON.stringify(bodyJS);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment