-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,8 @@ var debug = require('debug')('roon-extension-harmony'), | |
RoonApiSettings = require('node-roon-api-settings'), | ||
RoonApiSourceControl = require('node-roon-api-source-control'), | ||
Discover = require('harmonyhubjs-discover'), | ||
Harmony = require('harmonyhubjs-client'); | ||
Harmony = require('harmonyhubjs-client'), | ||
PortFinder = require('portfinder'); | ||
|
||
var util = require('util'); | ||
var EventEmitter = require('events').EventEmitter; | ||
|
@@ -67,22 +68,32 @@ function HarmonyDiscovery() { | |
|
||
self.hubs = []; | ||
|
||
self._discover = new Discover(61991); | ||
self._discover.on('update', function (hubs) { | ||
debug('received update event from harmonyhubjs-discover. there are \'%d\' hubs: %O', hubs.length, hubs); | ||
PortFinder.getPortPromise() | ||
.then((port) => { | ||
debug("Harmony Discovery - listening on port \'%d\'", port); | ||
|
||
self.hubs = hubs.map((entry) => { return new HarmonyHub(entry.friendlyName, entry.ip); }); | ||
}); | ||
self._discover = new Discover(port); | ||
self._discover.on('update', function (hubs) { | ||
debug("received update event from harmonyhubjs-discover. there are \'%d\' hubs: %O", hubs.length, hubs); | ||
|
||
self.hubs = hubs.map((entry) => { return new HarmonyHub(entry.friendlyName, entry.ip); }); | ||
}); | ||
|
||
self._discover.start(); | ||
self._discover.start(); | ||
}) | ||
.catch((error) => { | ||
debug("HarmonyDiscovery - Failed to find available port.", activity.id); | ||
|
||
console.log(error); | ||
}); | ||
} | ||
|
||
var harmonyDiscovery = new HarmonyDiscovery(); | ||
|
||
var roon = new RoonApi({ | ||
extension_id: 'org.pruessmann.roon.logitech.harmony', | ||
display_name: 'Logitech Harmony', | ||
display_version: '0.0.5', | ||
display_version: '0.0.6', | ||
publisher: 'Doc Bobo', | ||
email: '[email protected]', | ||
website: 'https://github.com/docbobo/roon-extension-harmony', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
{ | ||
"name": "roon-extension-harmony", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Roon Extension to let Roon control Logitech Harmony hubs", | ||
"main": "app.js", | ||
"author": "Doc Bobo <[email protected]> (https://blog.pruessmann.org/)", | ||
"license": "Apache-2.0", | ||
"private": true, | ||
"dependencies": { | ||
"debug": "^3.1.0", | ||
"portfinder": "^1.0.0", | ||
"harmonyhubjs-client": "^1.1.0", | ||
"harmonyhubjs-discover": "^1.0.0", | ||
"harmonyhubjs-discover": "^1.1.0", | ||
"node-roon-api": "github:roonlabs/node-roon-api#caca92e99fd6becfc97761d32333cf4cd914b438", | ||
"node-roon-api-settings": "github:roonlabs/node-roon-api-settings#67cd8ca156c5bcd01ea63833ceaaec6d6a79654d", | ||
"node-roon-api-source-control": "github:roonlabs/node-roon-api-source-control#31ba0da65baab2261df35b0c787516e6064532d6", | ||
|