Skip to content

Instantly share code, notes, and snippets.

@mdobson
Created June 23, 2014 18:15
Show Gist options
  • Save mdobson/53a68f4bd55dc99a9164 to your computer and use it in GitHub Desktop.
Save mdobson/53a68f4bd55dc99a9164 to your computer and use it in GitHub Desktop.
var util = require('util');
var zetta = require('zetta');
var Scout = zetta.Scout;
var HueBulb = require('./hue_bulb_driver');
var HueBulbScout = module.exports = function(){
Scout.call(this);
};
util.inherits(HueBulbScout, Scout);
HueBulbScout.prototype.init = function() {
var self = this;
var query = server.where({type: 'huehub'});
zetta.observe([query], function(huehub){
huehub.on('registered', function(){
huehub.api.lights(function(lights){
self.discover(HueBulb, light, huehub);
});
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment