Last active
October 30, 2015 20:10
Revisions
-
davidsulpy revised this gist
Oct 30, 2015 . 2 changed files with 15 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ var lightEmoji = ":o: Off"; if (drop.elems.switch.value.switch.value === true) { lightEmoji = ":bulb: On"; } var bodyJS = [ { key: "Smart Switch :red_circle:", value: drop.elems.switch.value['led-color'].value.red.value }, { key: "Smart Switch :green_apple:", value: drop.elems.switch.value['led-color'].value.green.value }, { key: "Smart Switch :large_blue_circle:", value: drop.elems.switch.value['led-color'].value.blue.value }, { key: "Smart Switch :zap: Volts", value: drop.elems.switch.value.power.value.volts.value }, { key: "Smart Switch :zap: Amps", value: drop.elems.switch.value.power.value.amps.value }, { key: "Smart Switch :zap: Watts", value: drop.elems.switch.value.power.value.watts.value }, { key: "Smart Switch :bulb:", value: lightEmoji } ]; return JSON.stringify(bodyJS); -
davidsulpy revised this gist
Oct 30, 2015 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ 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); -
davidsulpy created this gist
Oct 30, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,70 @@ { "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 } } } }