mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-08 05:31:55 +00:00
Bump api version
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user