mirror of
https://github.com/nicolabs/musiccast-repairkit.git
synced 2026-04-11 00:40:55 +02:00
+ logging source & dest IP
- not logging all events (for now)
This commit is contained in:
parent
e81536b917
commit
9e3ceca562
6
index.js
6
index.js
|
|
@ -7,6 +7,9 @@ const SPEAKERS_IP = process.env.SPEAKERS_IP;
|
|||
const LOCAL_IP = process.env.LOCAL_IP || "0.0.0.0";
|
||||
const INCOMING_EVENT_SERVER_PORT = parseInt(process.env.PORT) || 41100;
|
||||
|
||||
console.log("YAMAHA_IP=",YAMAHA_IP);
|
||||
console.log("SPEAKERS_IP=",SPEAKERS_IP);
|
||||
|
||||
const inputSourceToSoundProgam = inputSource => {
|
||||
switch (inputSource) {
|
||||
case 'airplay':
|
||||
|
|
@ -88,11 +91,12 @@ const sendEventServerAddress = port =>
|
|||
});
|
||||
|
||||
const handleIncomingEvent = event => {
|
||||
console.log(event)
|
||||
// TODO Log all events at debug level
|
||||
const isInputChanged = event.main && typeof event.main.input !== 'undefined';
|
||||
|
||||
// e.g. { main: { volume: 47 }, device_id: 'AC44F2852577' }
|
||||
if ( event.main && typeof event.main.volume !== 'undefined' ) {
|
||||
console.log(event);
|
||||
setVolume(SPEAKERS_IP,event.main.volume);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue