Skip to content

Instantly share code, notes, and snippets.

View AdamMagaluk's full-sized avatar
🚀

Adam Magaluk AdamMagaluk

🚀
View GitHub Profile
@AdamMagaluk
AdamMagaluk / config.js
Last active August 29, 2015 14:01
Zetta Device Package
var HueScout = require('zetta-hue-driver');
var PushNotificationScout = require('zetta-apigee-driver');
module.exports = function(runtime) {
runtime.scouts.push(HueScout);
runtime.scouts.push(PushNotificationScout);
};
@AdamMagaluk
AdamMagaluk / hue_scout.js
Last active August 29, 2015 14:01
Zetta Scoutes
var util = require('util')
, EventEmitter = require('events').EventEmitter
, hue = require("node-hue-api")
, HueApi = require("node-hue-api").HueApi
, HueHubDriver = require('./hue_hub')
, HueBulbDriver = require('./hue_bulb');
var HueScout = module.exports = function() {
this.interval = 15000;
EventEmitter.call(this);
@AdamMagaluk
AdamMagaluk / hue_hub.js
Last active August 29, 2015 14:01
Zetta Devices
/*
Hue Hub represents the hub interface to the hue bulbs
it also implents a group control of all hue bulbs.
Weeknesses
- A single state doesn't make sense.
- passing in a callback function for a new light is hacky.
- Could of just added a sub-device to the hub for each bulb.
- Error handling breaks stops zetta runtime. Ignoring all http errors
@AdamMagaluk
AdamMagaluk / all-device-demo.js
Last active August 29, 2015 14:01
Zetta Apps
var intelliChiliBlink = require('./lib/intellichili-blink')
, photosensorHue = require('./lib/photosensor-hue')
, intelliChiliPebble = require('./lib/intellichili-pebble')
, photosensorDisplay = require('./lib/photosensor-display')
, pebbleHue = require('./lib/pebble-hue');
var HelloApp = module.exports = function() {
this.name = 'hello';
};
var fs = require('fs');
var path = require('path');
var cpr = require('cpr');
var libDir = '/Applications/Arduino.app/Contents/Resources/Java/libraries/';
function parseProp(data){
var r = {};
data.split('\n').forEach(function(line){
line = line.split('=');
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=155 -DARDUINO_AVR_YUN -DARDUINO_ARCH_AVR -DUSB_VID=2341 -DUSB_PID=0x8041 -DUSB_MANUFACTURER='""' -DUSB_PRODUCT='"Arduino Yun"' -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/variants/yun -Inode_modules/test-lib/src -c -o .build/Cat.o /Users/ApigeeCorporation/Software/leo/examples/test-project/node_modules/test-lib/src/Cat.cpp
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=155 -DARDUINO_AVR_YUN -DARDUINO_ARCH_AVR -DUSB_VID=2341 -DUSB_PID=0x8041 -DUSB_MANUFACTURER='""' -DUSB_PRODUCT='"Arduino Yun"' -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/cores/arduino -I/Applicatio
{
"class": [
"camera"
],
"properties": {
"type": "camera",
"name": "joes-camera",
"data": {},
"state": "ready",
"streams": []
Anonymous UUID: 36BE683C-4900-78B6-9518-23978340262A
Tue Apr 15 11:41:34 2014
panic(cpu 0 caller 0xffffff801fe526ff): "a freed zone element has been modified: expected 0xdeadbeefdeadbeef but found 0xdeadbeefdeadbe00, bits changed 0xef, at offset 4472 of 8192 in zone: kalloc.8192"@/SourceCache/xnu/xnu-2422.90.20/osfmk/kern/zalloc.c:461
Backtrace (CPU 0), Frame : Return Address
0xffffff81f3d3bc10 : 0xffffff801fe22fa9
0xffffff81f3d3bc90 : 0xffffff801fe526ff
0xffffff81f3d3bcf0 : 0xffffff801fe51df9
0xffffff81f3d3bdf0 : 0xffffff801fe2aa6f
0xffffff81f3d3be20 : 0xffffff801fe13056
{"devices":[{"type":"huehub","name":"Hue Hub 001788fffe10857f","data":{"id":"001788fffe10857f","ipaddress":"192.168.1.3","registered":true,"user":"1ab21c9d276bbee7258ec85925e0e503","lightval":"on"}},{"type":"huebulb","name":"Hue Bulb Carl","data":{"id":"1","name":"Carl","hue":{"host":"192.168.1.3","username":"1ab21c9d276bbee7258ec85925e0e503"}}},{"type":"huebulb","name":"Hue Bulb Hue Lamp 2","data":{"id":"2","name":"Hue Lamp 2","hue":{"host":"192.168.1.3","username":"1ab21c9d276bbee7258ec85925e0e503"}}},{"type":"huebulb","name":"Hue Bulb Hue Lamp 3","data":{"id":"3","name":"Hue Lamp 3","hue":{"host":"192.168.1.3","username":"1ab21c9d276bbee7258ec85925e0e503"}}},{"type":"huebulb","name":"Hue Bulb Adam","data":{"id":"4","name":"Adam","hue":{"host":"192.168.1.3","username":"1ab21c9d276bbee7258ec85925e0e503"}}},{"type":"huebulb","name":"Hue Bulb Matt","data":{"id":"5","name":"Matt","hue":{"host":"192.168.1.3","username":"1ab21c9d276bbee7258ec85925e0e503"}}}]}
<Buffer 6c 69 62 70 65 62 62 6c 65>
<Buffer 00 09 6c 69 62 70 65 62 62 6c 65>
Data 0: 0 0
Data 1: 9 9
Data 2:l 108 6c
Data 3:i 105 69
Data 4:b 98 62
Data 5:p 112 70
Data 6:e 101 65