Plugin support

- Homebridge is now designed to be `npm install`d globally and
executed via "homebridge" script
  - Remove all specific accessories/platforms except for an example
  - New internal structure and "cli"
This commit is contained in:
Nick Farina
2015-10-18 16:34:21 -07:00
parent 6e5c35ec88
commit a3c0df1c7c
55 changed files with 675 additions and 13219 deletions

29
lib/cli.js Normal file
View File

@@ -0,0 +1,29 @@
var program = require('commander');
var hap = require("hap-nodejs");
var version = require('./version');
var Server = require('./server').Server;
var Plugin = require('./plugin').Plugin;
var User = require('./user').User;
'use strict';
module.exports = function() {
console.log("_____________________________________________________________________");
console.log("IMPORTANT: Homebridge is in the middle of some big changes.");
console.log(" Read more about it here:");
console.log(" https://github.com/nfarina/homebridge/wiki/Migration-Guide");
console.log("_____________________________________________________________________");
console.log("");
program
.version(version)
.option('-P, --plugin-path [path]', 'look for plugins installed at [path] as well as node_modules', function(p) { Plugin.addPluginPath(p); })
.option('-D, --debug', 'turn on debug level logging', function() { logger.setDebugEnabled(true) })
.parse(process.argv);
// Initialize HAP-NodeJS with a custom persist directory
hap.init(User.persistPath());
new Server().run();
}