From c7c09a0dfb4010a97bd1539911624a6dd9d6bbc3 Mon Sep 17 00:00:00 2001 From: Alistair Galbraith Date: Sat, 4 Jul 2015 09:52:38 -0700 Subject: [PATCH 1/2] Initial checkin of transport category support --- app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index f632e8b..7ed29d1 100644 --- a/app.js +++ b/app.js @@ -54,7 +54,7 @@ function loadAccessories() { var services = accessory.getServices(); // Create the HAP server for this accessory - createHAPServer(name, services); + createHAPServer(name, services, accessory.transportCategory); } } @@ -89,7 +89,7 @@ function loadPlatforms() { // hooks in and out of HomeKit for the HAP-NodeJS server. var services = accessory.getServices(); // Create the HAP server for this accessory - createHAPServer(accessory.name, services); + createHAPServer(accessory.name, services, accessory.transportCategory); } accessories.push.apply(accessories, foundAccessories); }) @@ -113,7 +113,7 @@ var accessoryServers = []; var accessoryControllers = []; var usernames = {}; -function createHAPServer(name, services) { +function createHAPServer(name, services, transportCategory) { var accessoryController = new accessoryController_Factor.AccessoryController(); //loop through services @@ -163,7 +163,7 @@ function createHAPServer(name, services) { // hardcode the PIN to something random (same PIN as HAP-NodeJS sample accessories) var pincode = "031-45-154"; - var accessory = new accessory_Factor.Accessory(name, username, storage, parseInt(nextPort), pincode, accessoryController); + var accessory = new accessory_Factor.Accessory(name, username, storage, parseInt(nextPort), pincode, accessoryController, transportCategory); accessoryServers[nextServer] = accessory; accessoryControllers[nextServer] = accessoryController; accessory.publishAccessory(); From edde04d757a6abd50aeb9410907ba908510e2baf Mon Sep 17 00:00:00 2001 From: Alistair Galbraith Date: Sat, 4 Jul 2015 11:35:27 -0700 Subject: [PATCH 2/2] Update to latest HAP-NodeJS to include Category support --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ead28e2..9f7efaa 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "license": "ISC", "dependencies": { - "hap-nodejs": "git+https://github.com/khaost/HAP-NodeJS#ff5d9f11deae7daf599723d8e2f350553a10645c", + "hap-nodejs": "git+https://github.com/khaost/HAP-NodeJS#2a1bc8d99a2009317ab5da93faebea34c89f197c", "ad2usb": "git+https://github.com/alistairg/node-ad2usb.git#local", "request": "2.49.x", "node-persist": "0.0.x",