From c1f161376327f6b621fdeb869664af5678812e11 Mon Sep 17 00:00:00 2001 From: Alistair Galbraith Date: Fri, 3 Jul 2015 21:29:35 -0700 Subject: [PATCH] Removed submodule for HAP-NodeJS and moved to NPM It seemed to be easier all around to use NPM to manage the dependancy on HAP-NodeJS. This PR removes the submodule, and adjusts the paths of all checked in shims to reference the NPM module instead. I also updated the documentation to reflect the simpler install ;) --- .gitmodules | 3 --- README.md | 8 ++------ accessories/AD2USB.js | 2 +- accessories/Carwings.js | 2 +- accessories/ELKM1.js | 2 +- accessories/HomeMatic.js | 2 +- accessories/Http.js | 2 +- accessories/LiftMaster.js | 2 +- accessories/Lockitron.js | 2 +- accessories/Sonos.js | 2 +- accessories/WeMo.js | 2 +- accessories/X10.js | 2 +- accessories/XfinityHome.js | 2 +- app.js | 8 ++++---- lib/HAP-NodeJS | 1 - package.json | 1 + platforms/Domoticz.js | 2 +- platforms/ISY.js | 2 +- platforms/PhilipsHue.js | 2 +- platforms/SmartThings.js | 2 +- platforms/Wink.js | 2 +- 21 files changed, 23 insertions(+), 30 deletions(-) delete mode 160000 lib/HAP-NodeJS diff --git a/.gitmodules b/.gitmodules index 696c0f1..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "lib/HAP-NodeJS"] - path = lib/HAP-NodeJS - url = https://github.com/KhaosT/HAP-NodeJS.git diff --git a/README.md b/README.md index 4a4e98e..55f4e85 100644 --- a/README.md +++ b/README.md @@ -53,17 +53,13 @@ Additionally, the shims I've created implement the bare minimum of HomeKit neede # Getting Started -OK, if you're still excited enough about ordering Siri to make your coffee (which, who wouldn't be!) then here's how to set things up. First, clone this repo and also init submodules to grab the [HAP-NodeJS](https://github.com/KhaosT/HAP-NodeJS) project which isn't in npm. You'll also need to run `npm install` on HAP-NodeJS: +OK, if you're still excited enough about ordering Siri to make your coffee (which, who wouldn't be!) then here's how to set things up. First, clone this repo: $ git clone https://github.com/nfarina/homebridge.git $ cd homebridge - $ git submodule init - $ git submodule update - $ npm install - $ cd lib/HAP-NodeJS $ npm install -**Node**: You'll need to have NodeJS version 0.12.x or better installed for `HAP-NodeJS` to load. +**Node**: You'll need to have NodeJS version 0.12.x or better installed for required submodule `HAP-NodeJS` to load. Now you should be able to run the homebridge server: diff --git a/accessories/AD2USB.js b/accessories/AD2USB.js index c142c8f..ea05377 100644 --- a/accessories/AD2USB.js +++ b/accessories/AD2USB.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var AD2USB = require('ad2usb'); var CUSTOM_PANEL_LCD_TEXT_CTYPE = "A3E7B8F9-216E-42C1-A21C-97D4E3BE52C8"; diff --git a/accessories/Carwings.js b/accessories/Carwings.js index 68f64e6..150c936 100644 --- a/accessories/Carwings.js +++ b/accessories/Carwings.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var carwings = require("carwingsjs"); function CarwingsAccessory(log, config) { diff --git a/accessories/ELKM1.js b/accessories/ELKM1.js index 7ac2ba3..d32cc1b 100644 --- a/accessories/ELKM1.js +++ b/accessories/ELKM1.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var elkington = require("elkington"); function ElkM1Accessory(log, config) { diff --git a/accessories/HomeMatic.js b/accessories/HomeMatic.js index 94f4ee7..ce575b1 100755 --- a/accessories/HomeMatic.js +++ b/accessories/HomeMatic.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var request = require("request"); function HomeMatic(log, config) { diff --git a/accessories/Http.js b/accessories/Http.js index bca9cfa..bfd418b 100644 --- a/accessories/Http.js +++ b/accessories/Http.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var request = require("request"); function HttpAccessory(log, config) { diff --git a/accessories/LiftMaster.js b/accessories/LiftMaster.js index 8b6b33f..8d67b6c 100644 --- a/accessories/LiftMaster.js +++ b/accessories/LiftMaster.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var request = require("request"); // This seems to be the "id" of the official LiftMaster iOS app diff --git a/accessories/Lockitron.js b/accessories/Lockitron.js index 05c4984..b5fd023 100644 --- a/accessories/Lockitron.js +++ b/accessories/Lockitron.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var request = require("request"); function LockitronAccessory(log, config) { diff --git a/accessories/Sonos.js b/accessories/Sonos.js index e64e4c2..5757b0c 100644 --- a/accessories/Sonos.js +++ b/accessories/Sonos.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var sonos = require('sonos'); function SonosAccessory(log, config) { diff --git a/accessories/WeMo.js b/accessories/WeMo.js index 42c6db2..6684370 100644 --- a/accessories/WeMo.js +++ b/accessories/WeMo.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var wemo = require('wemo'); // extend our search timeout from 5 seconds to 60 diff --git a/accessories/X10.js b/accessories/X10.js index 14d39df..6668a44 100644 --- a/accessories/X10.js +++ b/accessories/X10.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var request = require("request"); function X10(log, config) { diff --git a/accessories/XfinityHome.js b/accessories/XfinityHome.js index 7fc1701..cafdbd1 100644 --- a/accessories/XfinityHome.js +++ b/accessories/XfinityHome.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var request = require("request"); var xmldoc = require("xmldoc"); diff --git a/app.js b/app.js index 6b2bd77..f632e8b 100644 --- a/app.js +++ b/app.js @@ -101,10 +101,10 @@ function loadPlatforms() { // // Pull in required HAP-NodeJS stuff -var accessory_Factor = new require("./lib/HAP-NodeJS/Accessory.js"); -var accessoryController_Factor = new require("./lib/HAP-NodeJS/AccessoryController.js"); -var service_Factor = new require("./lib/HAP-NodeJS/Service.js"); -var characteristic_Factor = new require("./lib/HAP-NodeJS/Characteristic.js"); +var accessory_Factor = new require("HAP-NodeJS/Accessory.js"); +var accessoryController_Factor = new require("HAP-NodeJS/AccessoryController.js"); +var service_Factor = new require("HAP-NodeJS/Service.js"); +var characteristic_Factor = new require("HAP-NodeJS/Characteristic.js"); // Each accessory has its own little server. We'll need to allocate some ports for these servers var nextPort = 51826; diff --git a/lib/HAP-NodeJS b/lib/HAP-NodeJS deleted file mode 160000 index bb7f620..0000000 --- a/lib/HAP-NodeJS +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bb7f620d9a32426479829b344356716a16dd374a diff --git a/package.json b/package.json index f19c60b..47dda96 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "url": "git://github.com/nfarina/homebridge.git" }, "dependencies": { + "hap-nodejs": "git+https://github.com/khaost/HAP-NodeJS", "ad2usb": "git+https://github.com/alistairg/node-ad2usb.git#local", "request": "2.49.x", "node-persist": "0.0.x", diff --git a/platforms/Domoticz.js b/platforms/Domoticz.js index ee4e57c..aacce99 100644 --- a/platforms/Domoticz.js +++ b/platforms/Domoticz.js @@ -25,7 +25,7 @@ // When you attempt to add a device, it will ask for a "PIN code". // The default code for all HomeBridge accessories is 031-45-154. // -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var request = require("request"); function DomoticzPlatform(log, config){ diff --git a/platforms/ISY.js b/platforms/ISY.js index 6304b44..b4b20a8 100644 --- a/platforms/ISY.js +++ b/platforms/ISY.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var xml2js = require('xml2js'); var request = require('request'); var util = require('util'); diff --git a/platforms/PhilipsHue.js b/platforms/PhilipsHue.js index ae4e1e2..0988b06 100644 --- a/platforms/PhilipsHue.js +++ b/platforms/PhilipsHue.js @@ -33,7 +33,7 @@ var hue = require("node-hue-api"), HueApi = hue.HueApi, lightState = hue.lightState; -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); function PhilipsHuePlatform(log, config) { this.log = log; diff --git a/platforms/SmartThings.js b/platforms/SmartThings.js index 693b587..580e70b 100644 --- a/platforms/SmartThings.js +++ b/platforms/SmartThings.js @@ -1,7 +1,7 @@ // SmartThings JSON API SmartApp required // https://github.com/jnewland/SmartThings/blob/master/JSON.groovy // -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var request = require("request"); function SmartThingsPlatform(log, config){ diff --git a/platforms/Wink.js b/platforms/Wink.js index 7b6083f..e2ec455 100644 --- a/platforms/Wink.js +++ b/platforms/Wink.js @@ -1,4 +1,4 @@ -var types = require("../lib/HAP-NodeJS/accessories/types.js"); +var types = require("HAP-NodeJS/accessories/types.js"); var wink = require('wink-js'); var model = {