This file contains 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
var AWS = require('aws-sdk'); | |
const ddb = new AWS.DynamoDB(); | |
const http = require('https'); | |
exports.handler = (event, context, callback) => { | |
// Retrieve all events of the last 11 minutes | |
getLatestEvents((err, events) => { | |
if(err) console.log(err); | |
else { | |
console.log(events); |
This file contains 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
var AWS = require('aws-sdk'); | |
var iotdata = new AWS.IotData({endpoint: 'xxxxxxx.iot.eu-central-1.amazonaws.com'}); | |
const ddb = new AWS.DynamoDB(); | |
exports.handler = function(event, context) { | |
// 'Detected100Sn' is the property reported by the inductive sensor | |
if(event["Detected100Sn"]) { | |
logEvent("Closed", (err) => { | |
if(err) console.log(err); | |
This file contains 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
var AWS = require('aws-sdk'); | |
var iotdata = new AWS.IotData({endpoint: 'xxxxxxx.iot.eu-central-1.amazonaws.com'}); | |
const ddb = new AWS.DynamoDB(); | |
exports.handler = function(event, context) { | |
let body = { | |
"Buzzer": "On", | |
"Segment Blink": "On", | |
"Color": "Yellow" | |
}; |