-
-
Save mdobson/53a68f4bd55dc99a9164 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
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