Instantly share code, notes, and snippets.
Created
May 25, 2016 14:27
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
-
Save LosantGists/01baeee0669b660abe98034225eff364 to your computer and use it in GitHub Desktop.
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 characters
| { | |
| "globals": [ | |
| { | |
| "key": "toEmailAddress", | |
| "type": "string" | |
| }, | |
| { | |
| "key": "fromEmailAddress", | |
| "type": "string" | |
| }, | |
| { | |
| "key": "doublePushPhoneNumber", | |
| "type": "string" | |
| }, | |
| { | |
| "key": "batteryLowPhoneNumber", | |
| "type": "string" | |
| }, | |
| { | |
| "key": "lowVoltage", | |
| "type": "number" | |
| } | |
| ], | |
| "triggers": [ | |
| { | |
| "type": "webhook", | |
| "meta": { | |
| "category": "trigger", | |
| "name": "webhook", | |
| "label": "Button Pressed", | |
| "x": 520, | |
| "y": 40, | |
| "uiId": "S1Aov-qG" | |
| }, | |
| "config": { | |
| }, | |
| "key": "573c8798ec450b0100c0c47b", | |
| "outputIds": [ | |
| [ | |
| "SJmDTm9z" | |
| ] | |
| ] | |
| } | |
| ], | |
| "nodes": [ | |
| { | |
| "type": "StructureSmsNode", | |
| "meta": { | |
| "category": "output", | |
| "name": "structure-sms", | |
| "label": "Battery low SMS", | |
| "x": 820, | |
| "y": 380 | |
| }, | |
| "config": { | |
| "bodyTemplate": "Voltage is low! {{data.body.batteryVoltage}}", | |
| "phoneNumberTemplate": "{{globals.batteryLowPhoneNumber}}" | |
| }, | |
| "id": "H1z6oXqf", | |
| "outputIds": [ | |
| ] | |
| }, | |
| { | |
| "type": "RawFunctionNode", | |
| "meta": { | |
| "category": "logic", | |
| "name": "function", | |
| "label": "Parse battery", | |
| "x": 520, | |
| "y": 120 | |
| }, | |
| "config": { | |
| "script": "if(payload.data && payload.data.body && payload.data.body.batteryVoltage) {\npayload.data.body.parsedBatteryVoltage = parseFloat(payload.data.body.batteryVoltage);\n}\nreturn payload;" | |
| }, | |
| "id": "SJmDTm9z", | |
| "outputIds": [ | |
| [ | |
| "S11URQcz" | |
| ] | |
| ] | |
| }, | |
| { | |
| "type": "DebugNode", | |
| "meta": { | |
| "category": "output", | |
| "name": "debug", | |
| "label": "Debug", | |
| "x": 520, | |
| "y": 200 | |
| }, | |
| "config": { | |
| "message": "" | |
| }, | |
| "id": "S11URQcz", | |
| "outputIds": [ | |
| [ | |
| "B1Q_A79G", | |
| "ryYQKVzm", | |
| "SkoztNMQ", | |
| "HkrMFEfQ" | |
| ] | |
| ] | |
| }, | |
| { | |
| "type": "ConditionalNode", | |
| "meta": { | |
| "category": "logic", | |
| "name": "conditional", | |
| "label": "Is battery low?", | |
| "x": 820, | |
| "y": 300 | |
| }, | |
| "config": { | |
| "expression": "{{data.body.parsedBatteryVoltage}} < {{globals.lowVoltage}}" | |
| }, | |
| "id": "B1Q_A79G", | |
| "outputIds": [ | |
| [ | |
| ], | |
| [ | |
| "H1z6oXqf" | |
| ] | |
| ] | |
| }, | |
| { | |
| "type": "ConditionalNode", | |
| "meta": { | |
| "category": "logic", | |
| "name": "conditional", | |
| "label": "Single Push?", | |
| "x": 220, | |
| "y": 300 | |
| }, | |
| "config": { | |
| "expression": "{{data.body.clickType}} === 'SINGLE'" | |
| }, | |
| "id": "HkrMFEfQ", | |
| "outputIds": [ | |
| [ | |
| ], | |
| [ | |
| "Skfo5EMX" | |
| ] | |
| ] | |
| }, | |
| { | |
| "type": "ConditionalNode", | |
| "meta": { | |
| "category": "logic", | |
| "name": "conditional", | |
| "label": "Double Push?", | |
| "x": 420, | |
| "y": 300 | |
| }, | |
| "config": { | |
| "expression": "{{data.body.clickType}} === 'DOUBLE'" | |
| }, | |
| "id": "SkoztNMQ", | |
| "outputIds": [ | |
| [ | |
| ], | |
| [ | |
| "SyFsc4G7" | |
| ] | |
| ] | |
| }, | |
| { | |
| "type": "ConditionalNode", | |
| "meta": { | |
| "category": "logic", | |
| "name": "conditional", | |
| "label": "Long Push?", | |
| "x": 620, | |
| "y": 300 | |
| }, | |
| "config": { | |
| "expression": "{{data.body.clickType}} === 'LONG'" | |
| }, | |
| "id": "ryYQKVzm", | |
| "outputIds": [ | |
| [ | |
| ], | |
| [ | |
| "rJa9cEGm" | |
| ] | |
| ] | |
| }, | |
| { | |
| "type": "RecordEventNode", | |
| "meta": { | |
| "category": "output", | |
| "name": "event", | |
| "label": "Record Event", | |
| "x": 620, | |
| "y": 380, | |
| "levelType": "info" | |
| }, | |
| "config": { | |
| "messageTemplate": "Long-pressed at {{time}}", | |
| "subjectTemplate": "Button Long-Pressed", | |
| "eventIdPath": "", | |
| "eventDataPath": "", | |
| "level": "info" | |
| }, | |
| "id": "rJa9cEGm", | |
| "outputIds": [ | |
| ] | |
| }, | |
| { | |
| "type": "StructureEmailNode", | |
| "meta": { | |
| "category": "output", | |
| "name": "structure-email", | |
| "label": "Email", | |
| "x": 220, | |
| "y": 380 | |
| }, | |
| "config": { | |
| "bodyTemplate": "Just letting you know that the AWS IoT button was pressed at {{time}}!", | |
| "subjectTemplate": "AWS IoT Button Pressed", | |
| "fromTemplate": "{{globals.fromEmailAddress}}", | |
| "toAddresses": [ | |
| "{{globals.toEmailAddress}}", | |
| "{{globals.fromEmailAddress}}" | |
| ] | |
| }, | |
| "id": "Skfo5EMX", | |
| "outputIds": [ | |
| ] | |
| }, | |
| { | |
| "type": "StructureSmsNode", | |
| "meta": { | |
| "category": "output", | |
| "name": "structure-sms", | |
| "label": "SMS", | |
| "x": 420, | |
| "y": 380 | |
| }, | |
| "config": { | |
| "bodyTemplate": "Just letting you know that the AWS IoT button was pressed at {{time}}!", | |
| "phoneNumberTemplate": "{{globals.doublePushPhoneNumber}}" | |
| }, | |
| "id": "SyFsc4G7", | |
| "outputIds": [ | |
| ] | |
| } | |
| ], | |
| "name": "AWS IoT Button", | |
| "enabled": true, | |
| "description": "", | |
| "applicationId": "573c87549673780100556ffe", | |
| "_type": "flow", | |
| "_exportDate": "2016-05-24T20:48:10.337Z" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment