Skip to content

Instantly share code, notes, and snippets.

@jsdario
Last active November 16, 2017 23:49
Show Gist options
  • Save jsdario/4b1e2115e4ff1ac9e7e0797beb5dc796 to your computer and use it in GitHub Desktop.
Save jsdario/4b1e2115e4ff1ac9e7e0797beb5dc796 to your computer and use it in GitHub Desktop.
Bigfoot Smart Home samples
const bigfoot = require('@netbeast/bigfoot')
const gpio = require('rpi-gpio')
const device = {
id: 'raspberry-light-01',
name: 'Bedtime light',
topic: 'Bulb',
}
let state = {}
bigfoot.alive(device, function handler (commit, params) {
state = { ...state, ...params }
gpio.write(7, state.power, function(err) {
if (err) return console.error(err)
commit(state)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment