mirror of
https://github.com/mtan93/homebridge.git
synced 2026-04-15 06:13:11 +01:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4884087041 | ||
|
|
e1867b2bc0 | ||
|
|
4d0f9d86f6 | ||
|
|
ecda18029f | ||
|
|
efc570e5a9 | ||
|
|
b6cfe3ba7c | ||
|
|
f836d4a42c | ||
|
|
63ab1025e9 | ||
|
|
dc43d0b7c4 | ||
|
|
7c3543ba61 | ||
|
|
5adb5f3282 | ||
|
|
fedd341970 | ||
|
|
c7c9aa0150 | ||
|
|
e3e08414f6 | ||
|
|
ea9df45d2d | ||
|
|
7425f8beca | ||
|
|
dbb7b89cf9 | ||
|
|
4f000485db |
@@ -190,6 +190,7 @@ SamplePlatform.prototype.addAccessory = function(accessoryName) {
|
||||
// To help restore accessory in configureAccessory()
|
||||
// newAccessory.context.something = "Something"
|
||||
|
||||
// Make sure you provided a name for service otherwise it may not visible in some HomeKit apps.
|
||||
newAccessory.addService(Service.Lightbulb, "Test Light")
|
||||
.getCharacteristic(Characteristic.On)
|
||||
.on('set', function(value, callback) {
|
||||
|
||||
@@ -166,8 +166,12 @@ Plugin.installed = function() {
|
||||
// reconstruct full path
|
||||
var pluginPath = path.join(requirePath, name);
|
||||
|
||||
// we only care about directories
|
||||
if (!fs.statSync(pluginPath).isDirectory()) continue;
|
||||
try {
|
||||
// we only care about directories
|
||||
if (!fs.statSync(pluginPath).isDirectory()) continue;
|
||||
} catch (e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// does this module contain a package.json?
|
||||
var pjson;
|
||||
|
||||
@@ -23,7 +23,9 @@ module.exports = {
|
||||
Server: Server
|
||||
}
|
||||
|
||||
function Server(insecureAccess) {
|
||||
function Server(insecureAccess, opts) {
|
||||
opts = opts || {};
|
||||
|
||||
// Setup Accessory Cache Storage
|
||||
accessoryStorage.initSync({ dir: User.cachedAccessoryPath() });
|
||||
|
||||
@@ -46,7 +48,7 @@ function Server(insecureAccess) {
|
||||
}.bind(this));
|
||||
|
||||
this._plugins = this._loadPlugins(); // plugins[name] = Plugin instance
|
||||
this._config = this._loadConfig();
|
||||
this._config = opts.config || this._loadConfig();
|
||||
this._cachedPlatformAccessories = this._loadCachedPlatformAccessories();
|
||||
this._bridge = this._createBridge();
|
||||
|
||||
@@ -110,6 +112,7 @@ Server.prototype._publish = function() {
|
||||
|
||||
this._bridge.publish({
|
||||
username: bridgeConfig.username || "CC:22:3D:E3:CE:30",
|
||||
port: bridgeConfig.port || 0,
|
||||
pincode: bridgeConfig.pin || "031-45-154",
|
||||
category: Accessory.Categories.BRIDGE
|
||||
}, this._allowInsecureAccess);
|
||||
@@ -472,7 +475,7 @@ Server.prototype._handlePublishCameraAccessories = function(accessories) {
|
||||
var advertiseAddress = mac.generate(accessory.UUID);
|
||||
|
||||
if (this._publishedCameras[advertiseAddress]) {
|
||||
throw new Error("Camera accessory %s experienced an address collision.", accessory.displayName);
|
||||
throw new Error("Camera accessory " + accessory.displayName + " experienced an address collision.");
|
||||
} else {
|
||||
this._publishedCameras[advertiseAddress] = accessory;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "homebridge",
|
||||
"description": "HomeKit support for the impatient",
|
||||
"version": "0.4.2",
|
||||
"version": "0.4.10",
|
||||
"scripts": {
|
||||
"dev": "DEBUG=* ./bin/homebridge -D -P example-plugins/ || true"
|
||||
},
|
||||
@@ -26,7 +26,7 @@
|
||||
"dependencies": {
|
||||
"chalk": "^1.1.1",
|
||||
"commander": "2.8.1",
|
||||
"hap-nodejs": "0.4.7",
|
||||
"hap-nodejs": "0.4.15",
|
||||
"semver": "5.0.3",
|
||||
"node-persist": "^0.0.8"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user