Skip to content

Commit

Permalink
release v5.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Dec 19, 2024
1 parent d409706 commit b4702c1
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 91 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- after update to 4.7.x buttons, sensors, volume display type need to be configure again using config UI
- after update to 3.15.x need remove the accessory frome Home app and add it again

## [5.2.3] - (19.12.2024)

## Changes

- bump dependencies
- cleanup

## [5.2.0] - (01.12.2024)

## Changes
Expand Down
58 changes: 29 additions & 29 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DenonPlatform {
constructor(log, config, api) {
// only load if configured
if (!config || !Array.isArray(config.devices)) {
log.warn(`No configuration found for ${PluginName}`);
log.warn(`No configuration found for ${PluginName}.`);
return;
}
this.accessories = [];
Expand All @@ -21,7 +21,7 @@ class DenonPlatform {
try {
mkdirSync(prefDir, { recursive: true });
} catch (error) {
log.error(`Prepare directory error: ${error.message ?? error}`);
log.error(`Prepare directory error: ${error}.`);
return;
}

Expand All @@ -47,7 +47,7 @@ class DenonPlatform {
passwd: 'removed'
}
};
const debug1 = enableDebugMode ? log.info(`Device: ${host} ${deviceName}, Config: ${JSON.stringify(config, null, 2)}`) : false;
const debug1 = enableDebugMode ? log.info(`Device: ${host} ${deviceName}, Config: ${JSON.stringify(config, null, 2)}.`) : false;

//zones
const zoneControl = device.zoneControl;
Expand Down Expand Up @@ -75,7 +75,7 @@ class DenonPlatform {
}
});
} catch (error) {
log.error(`Device: ${host} ${deviceName}, Prepare files error: ${error}`);
log.error(`Device: ${host} ${deviceName}, Prepare files error: ${error}.`);
return;
}

Expand All @@ -92,19 +92,19 @@ class DenonPlatform {
log.info(devInfo);
})
.on('success', (message) => {
log.success(`Device: ${host} ${deviceName}, ${message}`);
log.success(`Device: ${host} ${deviceName}, ${message}.`);
})
.on('message', (message) => {
log.info(`Device: ${host} ${deviceName}, ${message}`);
log.info(`Device: ${host} ${deviceName}, ${message}.`);
})
.on('debug', (debug) => {
log.info(`Device: ${host} ${deviceName}, debug: ${debug}`);
log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
})
.on('warn', (warn) => {
log.warn(`Device: ${host} ${deviceName}, ${warn}`);
log.warn(`Device: ${host} ${deviceName}, ${warn}.`);
})
.on('error', async (error) => {
log.error(`Device: ${host} ${deviceName}, ${error}`);
log.error(`Device: ${host} ${deviceName}, ${error}.`);
});

//create impulse generator
Expand All @@ -123,7 +123,7 @@ class DenonPlatform {
//start impulse generator
impulseGenerator.start([{ name: 'start', sampling: 45000 }]);
} catch (error) {
log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}`);
log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}.`);
}
break;
case 1: //zone 1
Expand All @@ -137,19 +137,19 @@ class DenonPlatform {
log(devInfo);
})
.on('success', (message) => {
log.success(`Device: ${host} ${deviceName}, ${message}`);
log.success(`Device: ${host} ${deviceName}, ${message}.`);
})
.on('message', (message) => {
log(`Device: ${host} ${deviceName}, ${message}`);
log(`Device: ${host} ${deviceName}, ${message}.`);
})
.on('debug', (debug) => {
log(`Device: ${host} ${deviceName}, debug: ${debug}`);
log(`Device: ${host} ${deviceName}, debug: ${debug}.`);
})
.on('warn', (warn) => {
log.warn(`Device: ${host} ${deviceName}, ${warn}`);
log.warn(`Device: ${host} ${deviceName}, ${warn}.`);
})
.on('error', async (error) => {
log.error(`Device: ${host} ${deviceName}, ${error}`);
log.error(`Device: ${host} ${deviceName}, ${error}.`);
});

//create impulse generator
Expand All @@ -168,7 +168,7 @@ class DenonPlatform {
//start impulse generator
impulseGenerator.start([{ name: 'start', sampling: 45000 }]);
} catch (error) {
log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}`);
log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}.`);
}
break;
case 2: //zone 2
Expand All @@ -182,19 +182,19 @@ class DenonPlatform {
log.info(devInfo);
})
.on('success', (message) => {
log.success(`Device: ${host} ${deviceName}, ${message}`);
log.success(`Device: ${host} ${deviceName}, ${message}.`);
})
.on('message', (message) => {
log.info(`Device: ${host} ${deviceName}, ${message}`);
log.info(`Device: ${host} ${deviceName}, ${message}.`);
})
.on('debug', (debug) => {
log.info(`Device: ${host} ${deviceName}, debug: ${debug}`);
log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
})
.on('warn', (warn) => {
log.warn(`Device: ${host} ${deviceName}, ${warn}`);
log.warn(`Device: ${host} ${deviceName}, ${warn}.`);
})
.on('error', async (error) => {
log.error(`Device: ${host} ${deviceName}, ${error}`);
log.error(`Device: ${host} ${deviceName}, ${error}.`);
});

//create impulse generator
Expand All @@ -213,7 +213,7 @@ class DenonPlatform {
//start impulse generator
impulseGenerator.start([{ name: 'start', sampling: 45000 }]);
} catch (error) {
log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}`);
log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}.`);
}
break;
case 3: //surround
Expand All @@ -227,19 +227,19 @@ class DenonPlatform {
log.info(devInfo);
})
.on('success', (message) => {
log.success(`Device: ${host} ${deviceName}, ${message}`);
log.success(`Device: ${host} ${deviceName}, ${message}.`);
})
.on('message', (message) => {
log.info(`Device: ${host} ${deviceName}, ${message}`);
log.info(`Device: ${host} ${deviceName}, ${message}.`);
})
.on('debug', (debug) => {
log.info(`Device: ${host} ${deviceName}, debug: ${debug}`);
log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
})
.on('warn', (warn) => {
log.warn(`Device: ${host} ${deviceName}, ${warn}`);
log.warn(`Device: ${host} ${deviceName}, ${warn}.`);
})
.on('error', async (error) => {
log.error(`Device: ${host} ${deviceName}, ${error}`);
log.error(`Device: ${host} ${deviceName}, ${error}.`);
});

//create impulse generator
Expand All @@ -258,11 +258,11 @@ class DenonPlatform {
//start impulse generator
impulseGenerator.start([{ name: 'start', sampling: 45000 }]);
} catch (error) {
log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}`);
log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}.`);
}
break;
default:
log.warn(`Device: ${host} ${deviceName}, unknown zone: ${zoneControl}`);
log.warn(`Device: ${host} ${deviceName}, unknown zone: ${zoneControl}.`);
break;
}
await new Promise(resolve => setTimeout(resolve, 500));
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Denon TV",
"name": "homebridge-denon-tv",
"version": "5.2.2",
"version": "5.2.3",
"description": "Homebridge plugin to control Denon/Marantz AV Receivers.",
"license": "MIT",
"author": "grzegorz914",
Expand Down Expand Up @@ -36,7 +36,7 @@
"dependencies": {
"async-mqtt": "^2.6.3",
"axios": "^1.7.9",
"fast-xml-parser": "^4.5.0",
"fast-xml-parser": "^4.5.1",
"express": "^4.21.2"
},
"keywords": [
Expand Down
20 changes: 10 additions & 10 deletions src/denon.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ class Denon extends EventEmitter {
try {
await this.checkState();
} catch (error) {
const logError = config.disableLogConnectError ? false : this.emit('error', `Impulse generator check state error: ${error.message || error}.`);
const logError = config.disableLogConnectError ? false : this.emit('error', `Impulse generator error: ${error}`);
};
}).on('state', (state) => {
const emitState = state ? this.emit('success', `Impulse generator started.`) : this.emit('warn', `Impulse generator stopped.`);
const emitState = state ? this.emit('success', `Impulse generator started`) : this.emit('warn', `Impulse generator stopped`);
});
};

Expand Down Expand Up @@ -201,7 +201,7 @@ class Denon extends EventEmitter {

//check seriaql number
if (!serialNumber) {
this.emit('error', `Missing Serial Number.`);
this.emit('error', `Missing Serial Number`);
return;
}

Expand All @@ -218,14 +218,14 @@ class Denon extends EventEmitter {

//check inputs
if (!inputsExist) {
this.emit('warn', `Found: ${allInputs} inputs.`);
this.emit('warn', `Found: ${allInputs} inputs`);
}

//save inputs if exist
const saveInputs = inputsExist ? await this.saveData(this.inputsFile, allInputs) : false;

//connect to deice success
this.emit('success', `Connect Success.`)
this.emit('success', `Connect Success`)

//emit device info
this.emit('deviceInfo', manufacturer, modelName, serialNumber, firmwareRevision, deviceZones, apiVersion, supportPictureMode);
Expand All @@ -238,7 +238,7 @@ class Denon extends EventEmitter {

return true;
} catch (error) {
throw new Error(`Connect error: ${error.message || error}.`);
throw new Error(`Connect error: ${error}`);

};
};
Expand Down Expand Up @@ -316,7 +316,7 @@ class Denon extends EventEmitter {

return true;
} catch (error) {
throw new Error(`Check state error: ${error.message || error}.`);
throw new Error(`Check state error: ${error}`);
};
};

Expand Down Expand Up @@ -450,7 +450,7 @@ class Denon extends EventEmitter {

return allInputs;
} catch (error) {
throw new Error(`Get inputus error: ${error.message || error}`);
throw new Error(`Get inputus error: ${error}`);
}
};

Expand All @@ -461,7 +461,7 @@ class Denon extends EventEmitter {
const debug = this.debugLog ? this.emit('debug', `Saved data: ${data}`) : false;
return true;
} catch (error) {
throw new Error(`Save data error: ${error.message || error}`);
throw new Error(`Save data error: ${error}`);
};
};

Expand All @@ -471,7 +471,7 @@ class Denon extends EventEmitter {
await this.axiosInstance(path);
return true;
} catch (error) {
throw new Error(error);
throw new Error(`Send data error: ${error}`);
};
};
};
Expand Down
Loading

0 comments on commit b4702c1

Please sign in to comment.