Bump api version

This commit is contained in:
Khaos Tian
2016-09-26 13:19:50 -07:00
parent c89ff97ac5
commit ecd06d7239
2 changed files with 10 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ function API() {
this._dynamicPlatforms = {}; // this._dynamicPlatforms[pluginName.platformName] = platform constructor
// expose the homebridge API version
this.version = 2.0;
this.version = 2.1;
// expose the User class methods to plugins to get paths. Example: homebridge.user.storagePath()
this.user = User;

View File

@@ -52,6 +52,7 @@ function Server(insecureAccess) {
this._activeDynamicPlugins = {};
this._configurablePlatformPlugins = {};
this._publishedCameras = {};
this._setupManager = new BridgeSetupManager();
this._setupManager.on('newConfig', this._handleNewConfig.bind(this));
@@ -466,9 +467,16 @@ Server.prototype._handlePublishCameraAccessories = function(accessories) {
accessory._prepareAssociatedHAPAccessory();
var hapAccessory = accessory._associatedHAPAccessory;
var advertiseAddress = mac.generate(accessory.uuid);
if (this._publishedCameras[advertiseAddress]) {
throw new Error("Camera accessory %s experienced an address collision.", accessory.displayName);
} else {
this._publishedCameras[advertiseAddress] = accessory;
}
hapAccessory.publish({
username: mac.generate(accessory.uuid),
username: advertiseAddress,
pincode: bridgeConfig.pin || "031-45-154",
category: accessory.category
}, this._allowInsecureAccess);