mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-22 21:03:32 +00:00
init design
This commit is contained in:
12
lib/api.js
12
lib/api.js
@@ -85,6 +85,18 @@ API.prototype.registerAccessory = function(pluginName, accessoryName, constructo
|
||||
}
|
||||
}
|
||||
|
||||
API.prototype.publishCameraAccessories = function(pluginName, accessories) {
|
||||
for (var index in accessories) {
|
||||
var accessory = accessories[index];
|
||||
if (!(accessory instanceof PlatformAccessory)) {
|
||||
throw new Error(pluginName + " attempt to register an accessory that isn\'t PlatformAccessory!");
|
||||
}
|
||||
accessory._associatedPlugin = pluginName;
|
||||
}
|
||||
|
||||
this.emit('publishCameraAccessories', accessories);
|
||||
}
|
||||
|
||||
API.prototype.platform = function(name) {
|
||||
|
||||
// if you passed the "short form" name like "Lockitron" instead of "homebridge-lockitron.Lockitron",
|
||||
|
||||
Reference in New Issue
Block a user