mirror of
https://github.com/nicolabs/musiccast-repairkit.git
synced 2025-09-07 16:10:34 +02:00
~ major version boost
~ removed `conf.` prefix for scenario-specific options + added '-c' shortcut to '--config' ~ upgraded from yamaha-yxc-nodejs 0.x to 3.x ~ general dependencies upgrade - few docs & logs changes
This commit is contained in:
parent
c25d0d70b0
commit
2a89588dc4
15
CHANGELOG.md
Normal file
15
CHANGELOG.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Changes history
|
||||
|
||||
## 2.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- Scenario dynamic options changed : `--conf.` prefix does not exist anymore, the options directly start with the name of the script ; e.g. `--standby-together.source=<source_IP>` instead of previously `--conf.standby-together.source=<source_IP>`
|
||||
|
||||
### Other changes
|
||||
|
||||
- Upgraded `yamaha-yxc-nodejs` dependency to 3.x (was 0.x)
|
||||
|
||||
## 1.2.0
|
||||
|
||||
First release
|
31
README.md
31
README.md
|
@ -42,7 +42,7 @@ Currently the following mappings from source to sound program are hard coded. Yo
|
|||
spotify => music with clear_voice disabled
|
||||
airplay => music with clear_voice disabled
|
||||
|
||||
On the command line, use `-s scripts/audio-profile.js` to enable this script and use the `--conf.audio-profile.source=<source_IP>` option to set the hostname or IP address of the receiver.
|
||||
On the command line, use `-s scripts/audio-profile.js` to enable this script and use the `--audio-profile.source=<source_IP>` option to set the hostname or IP address of the receiver.
|
||||
|
||||
Top-level options (e.g. `--source`) and configuration file are also valid (see instructions below).
|
||||
|
||||
|
@ -62,8 +62,8 @@ This script will solve this by listening to volume changes on a source device an
|
|||
#### How to configure
|
||||
|
||||
On the command line, use `-s scripts/sync-volume.js` to enable this script and use the following options :
|
||||
- `--conf.sync-volume.source=<source_IP>` sets the hostname or IP address of the *master* receiver
|
||||
- `--conf.sync-volume.target=<target_IP [target_IP [...]]>` lists the *slave* devices that will reflect the master's volume changes. You can separate them with a space or pass the option several times.
|
||||
- `--sync-volume.source=<source_IP>` sets the hostname or IP address of the *master* receiver
|
||||
- `--sync-volume.target=<target_IP [target_IP [...]]>` lists the *slave* devices that will reflect the master's volume changes. You can separate them with a space or pass the option several times.
|
||||
|
||||
Top-level options (e.g. `--source`) and configuration file are also valid (see instructions below).
|
||||
|
||||
|
@ -80,8 +80,8 @@ This script will automatically force a given list of devices to power on or off
|
|||
#### How to configure
|
||||
|
||||
On the command line, use `-s scripts/standby-together.js` to enable this script and use the following options :
|
||||
- `--conf.standby-together.source=<source_IP>` sets the hostname or IP address of the *master* receiver
|
||||
- `--conf.standby-together.target=<target_IP [target_IP [...]]>` lists the *slave* devices that will follow the master's power status. You can separate them with a space or pass the option several times.
|
||||
- `--standby-together.source=<source_IP>` sets the hostname or IP address of the *master* receiver
|
||||
- `--standby-together.target=<target_IP [target_IP [...]]>` lists the *slave* devices that will follow the master's power status. You can separate them with a space or pass the option several times.
|
||||
|
||||
Top-level options (e.g. `--source`) and configuration file are also valid (see instructions below).
|
||||
|
||||
|
@ -90,6 +90,10 @@ Top-level options (e.g. `--source`) and configuration file are also valid (see i
|
|||
|
||||
This program requires [Node.js](https://nodejs.org) to run.
|
||||
|
||||
Previously to running it, you need to install dependencies by running the following command in the source directory :
|
||||
|
||||
npm install
|
||||
|
||||
When running the program you need to specify which scenarios to run.
|
||||
The scenarios are `.js` scripts which implement the use cases above. More details in the next sections.
|
||||
|
||||
|
@ -99,27 +103,24 @@ Use the **`-s` command line option to specify which script(s) to load** ; for ex
|
|||
|
||||
You can pass all options on the command line, or use the **`--config` option to store them in a JSON file** ; example :
|
||||
|
||||
|
||||
node . -s ./scripts/sync-volume.js --config config.json
|
||||
|
||||
Contents of config.json :
|
||||
|
||||
```json
|
||||
{
|
||||
"conf": {
|
||||
"sync-volume": {
|
||||
"source": "192.168.1.42",
|
||||
"target": [
|
||||
"192.168.1.43",
|
||||
"192.168.1.44"
|
||||
]
|
||||
}
|
||||
"sync-volume": {
|
||||
"source": "192.168.1.42",
|
||||
"target": [
|
||||
"192.168.1.43",
|
||||
"192.168.1.44"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can define **generic options** at the top level and **scenario-specific options** under a prefix named after the script's name (its filename without extension).
|
||||
For instance with `--source 1.2.3.4 --conf.sync-volume.source 5.6.7.8`, `1.2.3.4` will be used as the *source* parameter by default but `5.6.7.8` will be used for the *sync-volume* scenario only.
|
||||
For instance with `--source 1.2.3.4 --sync-volume.source 5.6.7.8`, `1.2.3.4` will be used as the *source* parameter by default but `5.6.7.8` will be used for the *sync-volume* scenario only.
|
||||
|
||||
You can pass those arguments multiple times or provide space-separated values if you need to.
|
||||
|
||||
|
|
55
index.js
55
index.js
|
@ -2,13 +2,14 @@ const yargs = require('yargs');
|
|||
const path = require('path');
|
||||
const log = require('./logging');
|
||||
const udp = require('dgram');
|
||||
const server = udp.createSocket('udp4');
|
||||
const http = require('http');
|
||||
const YamahaYXC = require('yamaha-yxc-nodejs');
|
||||
const YamahaYXC = require('yamaha-yxc-nodejs').YamahaYXC;
|
||||
|
||||
const LOCAL_IP = process.env.LOCAL_IP || "0.0.0.0";
|
||||
const INCOMING_EVENT_SERVER_PORT = parseInt(process.env.PORT) || 41100;
|
||||
|
||||
|
||||
|
||||
// Takes signals into account (and also Ctrl+C from the console)
|
||||
// See https://github.com/nodejs/node/issues/4182
|
||||
function exitOnSignal(signal) {
|
||||
|
@ -19,6 +20,12 @@ function exitOnSignal(signal) {
|
|||
exitOnSignal('SIGINT');
|
||||
exitOnSignal('SIGTERM');
|
||||
|
||||
|
||||
|
||||
//
|
||||
// MusicCast utility functions
|
||||
//
|
||||
|
||||
const send = (host, path, headers) =>
|
||||
http
|
||||
.get(
|
||||
|
@ -60,6 +67,14 @@ const sendEventServerAddress = (hostname,port) => {
|
|||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Instanciates the server
|
||||
//
|
||||
|
||||
const server = udp.createSocket('udp4');
|
||||
|
||||
server.on('close', () => {
|
||||
log.info('Server is closed!');
|
||||
// TODO ? Notify the device not to send events anymore ?
|
||||
|
@ -70,6 +85,7 @@ server.on('error', error => {
|
|||
server.close();
|
||||
});
|
||||
|
||||
// Executes the scenarii for each received MusicCast message
|
||||
server.on('message', (msg, _info) => {
|
||||
let body = '';
|
||||
|
||||
|
@ -87,6 +103,7 @@ server.on('message', (msg, _info) => {
|
|||
}
|
||||
});
|
||||
|
||||
// Initializes the server once it is listening to the network
|
||||
server.on('listening', () => {
|
||||
const address = server.address();
|
||||
const port = address.port;
|
||||
|
@ -98,7 +115,7 @@ server.on('listening', () => {
|
|||
var sourcesDict = {};
|
||||
for ( s=0 ; s<scenarii.length ; s++ ) {
|
||||
var scenario = scenarii[s];
|
||||
if ( scenario.conf && typeof scenario.conf !== 'undefined' &&
|
||||
if ( scenario && typeof scenario !== 'undefined' &&
|
||||
scenario.conf.source && typeof scenario.conf.source !== 'undefined' ) {
|
||||
sourcesDict[scenario.conf.source] = true;
|
||||
}
|
||||
|
@ -115,7 +132,12 @@ server.on('listening', () => {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Command line parsing
|
||||
//
|
||||
|
||||
const argv = yargs
|
||||
.option('s', {
|
||||
alias: ['scripts'],
|
||||
|
@ -131,7 +153,9 @@ const argv = yargs
|
|||
type: 'string'
|
||||
})
|
||||
// --config : configuration as a whole .json file
|
||||
.config()
|
||||
.config('config')
|
||||
// -c : shortcut for --config
|
||||
.config('c')
|
||||
.help()
|
||||
.alias('help', 'h')
|
||||
.argv;
|
||||
|
@ -143,23 +167,28 @@ if ( argv.l !== undefined ) {
|
|||
|
||||
log.debug("argv: %o", argv);
|
||||
|
||||
// Instanciates the handlers for each scenario
|
||||
|
||||
|
||||
//
|
||||
// Bootstrap configuration : instanciates the handlers for each scenario
|
||||
//
|
||||
|
||||
var scenarii = [];
|
||||
const scripts = argv.scripts;
|
||||
for ( var s=0 ; s<scripts.length ; s++ ) {
|
||||
var scenarioModule = scripts[s];
|
||||
|
||||
log.info("Loading scenario : %s", scenarioModule);
|
||||
log.debug("Loading scenario : %s", scenarioModule);
|
||||
var scenarioClass = require(scenarioModule);
|
||||
|
||||
var scenarioName = path.basename(scenarioModule, path.extname(scenarioModule));
|
||||
log.info("Scenario name : %s", scenarioName);
|
||||
log.debug("Scenario name : %s", scenarioName);
|
||||
// Merges top options and scenario-specific ones (specific overrides top ones)
|
||||
var conf = Object.assign({}, argv);
|
||||
if ( argv.conf !== undefined && argv.conf[scenarioName] !== undefined ) {
|
||||
conf = Object.assign(conf, argv.conf[scenarioName]);
|
||||
if ( argv !== undefined && argv[scenarioName] !== undefined ) {
|
||||
conf = Object.assign(conf, argv[scenarioName]);
|
||||
}
|
||||
log.info("Scenario conf. %o :", conf);
|
||||
log.debug("Scenario conf : %o :", conf);
|
||||
|
||||
scenarii.push({
|
||||
name: scenarioName,
|
||||
|
@ -170,4 +199,10 @@ for ( var s=0 ; s<scripts.length ; s++ ) {
|
|||
log.info("Scenarii : %o", scenarii);
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Starts the server
|
||||
//
|
||||
|
||||
log.debug("server.bind(%s,%s)", INCOMING_EVENT_SERVER_PORT, LOCAL_IP);
|
||||
server.bind(INCOMING_EVENT_SERVER_PORT, LOCAL_IP);
|
||||
|
|
254
package-lock.json
generated
254
package-lock.json
generated
|
@ -1,16 +1,17 @@
|
|||
{
|
||||
"name": "musiccast-repairkit",
|
||||
"version": "1.2.0",
|
||||
"version": "2.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"version": "1.2.0",
|
||||
"name": "musiccast-repairkit",
|
||||
"version": "2.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"winston": "^3.3.3",
|
||||
"yamaha-yxc-nodejs": "0.0.13",
|
||||
"yargs": "^16.2.0"
|
||||
"yamaha-yxc-nodejs": "3.1.2",
|
||||
"yargs": "^17.7.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
|
@ -27,14 +28,14 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@root/request": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@root/request/-/request-1.7.0.tgz",
|
||||
"integrity": "sha512-lre7XVeEwszgyrayWWb/kRn5fuJfa+n0Nh+rflM9E+EpC28yIYA+FPm/OL1uhzp3TxhQM0HFN4FE2RDIPGlnmg=="
|
||||
"version": "1.9.2",
|
||||
"resolved": "https://registry.npmjs.org/@root/request/-/request-1.9.2.tgz",
|
||||
"integrity": "sha512-wVaL9yVV9oDR9UNbPZa20qgY+4Ch6YN8JUkaE4el/uuS5dmhD8Lusm/ku8qJVNtmQA56XLzEDCRS6/vfpiHK2A=="
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
||||
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
|
@ -51,23 +52,21 @@
|
|||
}
|
||||
},
|
||||
"node_modules/async": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz",
|
||||
"integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw=="
|
||||
},
|
||||
"node_modules/bluebird": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
||||
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz",
|
||||
"integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ=="
|
||||
},
|
||||
"node_modules/cliui": {
|
||||
"version": "7.0.4",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
|
||||
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
||||
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
|
||||
"dependencies": {
|
||||
"string-width": "4.2.2",
|
||||
"strip-ansi": "6.0.0",
|
||||
"wrap-ansi": "7.0.0"
|
||||
"string-width": "^4.2.0",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"wrap-ansi": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/color": {
|
||||
|
@ -241,11 +240,6 @@
|
|||
"fn.name": "1.x.x"
|
||||
}
|
||||
},
|
||||
"node_modules/peer-ssdp": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/peer-ssdp/-/peer-ssdp-0.0.5.tgz",
|
||||
"integrity": "sha1-G5FVuolGXszE3iy6LAOOSf3iooE="
|
||||
},
|
||||
"node_modules/process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
|
@ -291,6 +285,14 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"node_modules/simple-ssdp": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/simple-ssdp/-/simple-ssdp-1.0.2.tgz",
|
||||
"integrity": "sha512-EhvU5QBcKs2grpZ+SIBxOcq3t2oTdTKuBDWxkq6qPHppS3KASKyd8pM4tC4TYfgWxhvZJtuEgT5G0677mi7S4w==",
|
||||
"dependencies": {
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/simple-swizzle": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
|
||||
|
@ -316,24 +318,24 @@
|
|||
}
|
||||
},
|
||||
"node_modules/string-width": {
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
|
||||
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"dependencies": {
|
||||
"emoji-regex": "8.0.0",
|
||||
"is-fullwidth-code-point": "3.0.0",
|
||||
"strip-ansi": "6.0.0"
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-ansi": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
|
||||
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"dependencies": {
|
||||
"ansi-regex": "5.0.0"
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
|
@ -354,6 +356,14 @@
|
|||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/winston": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz",
|
||||
|
@ -417,12 +427,15 @@
|
|||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
||||
"dependencies": {
|
||||
"ansi-styles": "4.3.0",
|
||||
"string-width": "4.2.2",
|
||||
"strip-ansi": "6.0.0"
|
||||
"ansi-styles": "^4.0.0",
|
||||
"string-width": "^4.1.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/y18n": {
|
||||
|
@ -434,38 +447,37 @@
|
|||
}
|
||||
},
|
||||
"node_modules/yamaha-yxc-nodejs": {
|
||||
"version": "0.0.13",
|
||||
"resolved": "https://registry.npmjs.org/yamaha-yxc-nodejs/-/yamaha-yxc-nodejs-0.0.13.tgz",
|
||||
"integrity": "sha512-RDnQR5ar8mPfc34QUvSTqDuNKOnb4MssQb7aAQ7ISYx+Fel0EA8BUBm4J8jlVZannxMOqWKpkauW4VVCDOUtPQ==",
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/yamaha-yxc-nodejs/-/yamaha-yxc-nodejs-3.1.2.tgz",
|
||||
"integrity": "sha512-Dv2AR2yw8ZhaN5pKjlcrKUQiY42X+FKEDuKToIB8yZ6NIFEkkVWyoU/keUH7TiWLepGm0VZLl3ldtICssZj7JQ==",
|
||||
"dependencies": {
|
||||
"@root/request": "1.7.0",
|
||||
"bluebird": "3.7.2",
|
||||
"peer-ssdp": "0.0.5"
|
||||
"@root/request": "^1.9.2",
|
||||
"simple-ssdp": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs": {
|
||||
"version": "16.2.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
|
||||
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
|
||||
"version": "17.7.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz",
|
||||
"integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==",
|
||||
"dependencies": {
|
||||
"cliui": "7.0.4",
|
||||
"escalade": "3.1.1",
|
||||
"get-caller-file": "2.0.5",
|
||||
"require-directory": "2.1.1",
|
||||
"string-width": "4.2.2",
|
||||
"y18n": "5.0.5",
|
||||
"yargs-parser": "20.2.7"
|
||||
"cliui": "^8.0.1",
|
||||
"escalade": "^3.1.1",
|
||||
"get-caller-file": "^2.0.5",
|
||||
"require-directory": "^2.1.1",
|
||||
"string-width": "^4.2.3",
|
||||
"y18n": "^5.0.5",
|
||||
"yargs-parser": "^21.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs-parser": {
|
||||
"version": "20.2.7",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz",
|
||||
"integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==",
|
||||
"version": "21.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
|
||||
"integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": ">=12"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -481,14 +493,14 @@
|
|||
}
|
||||
},
|
||||
"@root/request": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@root/request/-/request-1.7.0.tgz",
|
||||
"integrity": "sha512-lre7XVeEwszgyrayWWb/kRn5fuJfa+n0Nh+rflM9E+EpC28yIYA+FPm/OL1uhzp3TxhQM0HFN4FE2RDIPGlnmg=="
|
||||
"version": "1.9.2",
|
||||
"resolved": "https://registry.npmjs.org/@root/request/-/request-1.9.2.tgz",
|
||||
"integrity": "sha512-wVaL9yVV9oDR9UNbPZa20qgY+4Ch6YN8JUkaE4el/uuS5dmhD8Lusm/ku8qJVNtmQA56XLzEDCRS6/vfpiHK2A=="
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
||||
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
|
@ -499,23 +511,18 @@
|
|||
}
|
||||
},
|
||||
"async": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz",
|
||||
"integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw=="
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
||||
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz",
|
||||
"integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ=="
|
||||
},
|
||||
"cliui": {
|
||||
"version": "7.0.4",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
|
||||
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
||||
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
|
||||
"requires": {
|
||||
"string-width": "4.2.2",
|
||||
"strip-ansi": "6.0.0",
|
||||
"wrap-ansi": "7.0.0"
|
||||
"string-width": "^4.2.0",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"wrap-ansi": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
|
@ -673,11 +680,6 @@
|
|||
"fn.name": "1.x.x"
|
||||
}
|
||||
},
|
||||
"peer-ssdp": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/peer-ssdp/-/peer-ssdp-0.0.5.tgz",
|
||||
"integrity": "sha1-G5FVuolGXszE3iy6LAOOSf3iooE="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
|
@ -703,6 +705,14 @@
|
|||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||
},
|
||||
"simple-ssdp": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/simple-ssdp/-/simple-ssdp-1.0.2.tgz",
|
||||
"integrity": "sha512-EhvU5QBcKs2grpZ+SIBxOcq3t2oTdTKuBDWxkq6qPHppS3KASKyd8pM4tC4TYfgWxhvZJtuEgT5G0677mi7S4w==",
|
||||
"requires": {
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
},
|
||||
"simple-swizzle": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
|
||||
|
@ -725,21 +735,21 @@
|
|||
}
|
||||
},
|
||||
"string-width": {
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
|
||||
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"requires": {
|
||||
"emoji-regex": "8.0.0",
|
||||
"is-fullwidth-code-point": "3.0.0",
|
||||
"strip-ansi": "6.0.0"
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
|
||||
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"requires": {
|
||||
"ansi-regex": "5.0.0"
|
||||
"ansi-regex": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"text-hex": {
|
||||
|
@ -757,6 +767,11 @@
|
|||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||
},
|
||||
"winston": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz",
|
||||
|
@ -816,9 +831,9 @@
|
|||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
||||
"requires": {
|
||||
"ansi-styles": "4.3.0",
|
||||
"string-width": "4.2.2",
|
||||
"strip-ansi": "6.0.0"
|
||||
"ansi-styles": "^4.0.0",
|
||||
"string-width": "^4.1.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"y18n": {
|
||||
|
@ -827,33 +842,32 @@
|
|||
"integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg=="
|
||||
},
|
||||
"yamaha-yxc-nodejs": {
|
||||
"version": "0.0.13",
|
||||
"resolved": "https://registry.npmjs.org/yamaha-yxc-nodejs/-/yamaha-yxc-nodejs-0.0.13.tgz",
|
||||
"integrity": "sha512-RDnQR5ar8mPfc34QUvSTqDuNKOnb4MssQb7aAQ7ISYx+Fel0EA8BUBm4J8jlVZannxMOqWKpkauW4VVCDOUtPQ==",
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/yamaha-yxc-nodejs/-/yamaha-yxc-nodejs-3.1.2.tgz",
|
||||
"integrity": "sha512-Dv2AR2yw8ZhaN5pKjlcrKUQiY42X+FKEDuKToIB8yZ6NIFEkkVWyoU/keUH7TiWLepGm0VZLl3ldtICssZj7JQ==",
|
||||
"requires": {
|
||||
"@root/request": "1.7.0",
|
||||
"bluebird": "3.7.2",
|
||||
"peer-ssdp": "0.0.5"
|
||||
"@root/request": "^1.9.2",
|
||||
"simple-ssdp": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"yargs": {
|
||||
"version": "16.2.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
|
||||
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
|
||||
"version": "17.7.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz",
|
||||
"integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==",
|
||||
"requires": {
|
||||
"cliui": "7.0.4",
|
||||
"escalade": "3.1.1",
|
||||
"get-caller-file": "2.0.5",
|
||||
"require-directory": "2.1.1",
|
||||
"string-width": "4.2.2",
|
||||
"y18n": "5.0.5",
|
||||
"yargs-parser": "20.2.7"
|
||||
"cliui": "^8.0.1",
|
||||
"escalade": "^3.1.1",
|
||||
"get-caller-file": "^2.0.5",
|
||||
"require-directory": "^2.1.1",
|
||||
"string-width": "^4.2.3",
|
||||
"y18n": "^5.0.5",
|
||||
"yargs-parser": "^21.1.1"
|
||||
}
|
||||
},
|
||||
"yargs-parser": {
|
||||
"version": "20.2.7",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz",
|
||||
"integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw=="
|
||||
"version": "21.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
|
||||
"integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "musiccast-repairkit",
|
||||
"version": "1.2.0",
|
||||
"version": "2.0.0",
|
||||
"main": "index.js",
|
||||
"author": "nicobo (https://www.nicolabs.net/people/nicobo)",
|
||||
"license": "MIT",
|
||||
|
@ -10,7 +10,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"winston": "^3.3.3",
|
||||
"yamaha-yxc-nodejs": "0.0.13",
|
||||
"yargs": "^16.2.0"
|
||||
"yamaha-yxc-nodejs": "3.1.2",
|
||||
"yargs": "^17.7.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const log = require('../logging');
|
||||
const YamahaYXC = require('yamaha-yxc-nodejs');
|
||||
const YamahaYXC = require('yamaha-yxc-nodejs').YamahaYXC;
|
||||
|
||||
const inputSourceToSoundProgam = inputSource => {
|
||||
switch (inputSource) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const log = require('../logging');
|
||||
const YamahaYXC = require('yamaha-yxc-nodejs');
|
||||
const YamahaYXC = require('yamaha-yxc-nodejs').YamahaYXC;
|
||||
|
||||
module.exports = class Scenario {
|
||||
|
||||
|
@ -18,7 +18,8 @@ module.exports = class Scenario {
|
|||
var source = new YamahaYXC(configuration.source);
|
||||
source.getDeviceInfo().
|
||||
then( result => {
|
||||
source.deviceInfo = JSON.parse(result);
|
||||
// result is a JSON object
|
||||
source.deviceInfo = result;
|
||||
log.debug("Source : %s",source);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const log = require('../logging');
|
||||
const YamahaYXC = require('yamaha-yxc-nodejs');
|
||||
const YamahaYXC = require('yamaha-yxc-nodejs').YamahaYXC;
|
||||
|
||||
module.exports = class Scenario {
|
||||
|
||||
|
@ -18,7 +18,8 @@ module.exports = class Scenario {
|
|||
var source = new YamahaYXC(configuration.source);
|
||||
source.getDeviceInfo().
|
||||
then( result => {
|
||||
source.deviceInfo = JSON.parse(result);
|
||||
// result is a JSON object
|
||||
source.deviceInfo = result;
|
||||
log.debug("Source : %s",source);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue