Merge pull request #941 from djMax/master

Allow externally specified config
This commit is contained in:
Khaos Tian
2016-11-21 12:04:57 -08:00
committed by GitHub

View File

@@ -23,7 +23,9 @@ module.exports = {
Server: Server Server: Server
} }
function Server(insecureAccess) { function Server(insecureAccess, opts) {
opts = opts || {};
// Setup Accessory Cache Storage // Setup Accessory Cache Storage
accessoryStorage.initSync({ dir: User.cachedAccessoryPath() }); accessoryStorage.initSync({ dir: User.cachedAccessoryPath() });
@@ -46,7 +48,7 @@ function Server(insecureAccess) {
}.bind(this)); }.bind(this));
this._plugins = this._loadPlugins(); // plugins[name] = Plugin instance this._plugins = this._loadPlugins(); // plugins[name] = Plugin instance
this._config = this._loadConfig(); this._config = opts.config || this._loadConfig();
this._cachedPlatformAccessories = this._loadCachedPlatformAccessories(); this._cachedPlatformAccessories = this._loadCachedPlatformAccessories();
this._bridge = this._createBridge(); this._bridge = this._createBridge();