Skip to content

Commit

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

## [4.14.0] - (04.08.2024)
## Changes
- added possiblity to set own volume control name and enable/disable prefix [#271](https://github.com/grzegorz914/homebridge-denon-tv/issues/271)
- config schema updated
- bump dependencies
- cleanup

## [4.13.28] - (03.08.2024)
## Changes
- fix custom inputs names not working [#270](https://github.com/grzegorz914/homebridge-denon-tv/issues/270)
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,19 @@ Tested Denon AVR-2112CI, AVR-3311CI, AVR-X6300H, AVR-X2700H, AVC-X4800H, Marantz
| `sensorSurrounds.reference` | Here choose `Sensor Reference`, sensor fired if switch to this reference. |
| `sensorSurrounds.displayType` | Here choose characteristic type to be exposed in HomeKit app, `0 - None/Disabled`, `1 - Motion Sensor`, `2 - Occupancy Sensor`, `3 - Contact Sensor`. |
| `sensorSurrounds.namePrefix` | Here enable/disable the accessory name as a prefix for sensor name. |
| `enableDebugMode` | If enabled, deep log will be present in homebridge console. |
| `disableLogInfo` | If enabled, disable log info, all values and state will not be displayed in Homebridge log console. |
| `disableLogDeviceInfo` | If enabled, add ability to disable log device info by every connections device to the network. |
| `disableLogConnectError` | If enabled, disable logging device connect error. |
| `masterPower` | If enabled, then the Power switch for that zone will turn the entire receiver `ON` or `OFF/STANDBY` rather than just the zone itself. |
| `masterVolume`| If enabled, then the Volume for that zone will set the entire receiver `UP` or `DOWN` rather than just the zone itself, (only for the Zone 1 and 2). |
| `masterMute`| If enabled, then the Mute switch for that zone will muted the entire receiver `ON` or `OFF` rather than just the zone itself, (only for the Zone 1 and 2). |
| `volumeControlNamePrefix` | Here enable/disable the accessory name as a prefix for volume control name. |
| `volumeControlName` | Here set Your own volume control name or leave empty. |
| `volumeControl` | Here choose what a additional volume control mode You want to use, `0 - None/Disabled`, `1 - Lightbulb`, `2 - Fan`. |
| `volumeMax` | Here set the maximum possible volume to set, `0 - 100`. |
| `infoButtonCommand` | Here choose the function for `I` button in RC app. |
| `refreshInterval` | Here set the data refresh interval. |
| `enableDebugMode` | If enabled, deep log will be present in homebridge console. |
| `disableLogInfo` | If enabled, disable log info, all values and state will not be displayed in Homebridge log console. |
| `disableLogDeviceInfo` | If enabled, add ability to disable log device info by every connections device to the network. |
| `disableLogConnectError` | If enabled, disable logging device connect error. |
| `enableRestFul` | If enabled, RESTful server will start automatically and respond to any path request. |
| `restFulPort` | Here set the listening `Port` for RESTful server, every zone need own port. |
| `restFulDebug` | If enabled, deep log will be present in homebridge console for RESTFul server. |
Expand Down
84 changes: 53 additions & 31 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6443,33 +6443,6 @@
},
"required": false
},
"masterPower": {
"title": "Master Power Control",
"type": "boolean",
"default": false,
"description": "The power switch for that zone will turn the entire receiver *ON* or *OFF/STANDBY* rather than just the zone itself.",
"required": false
},
"masterVolume": {
"title": "Master Volume Control",
"type": "boolean",
"default": false,
"description": "The volume for that zone will set the entire receiver volume *UP* or *DOWN* rather than just the zone itself.",
"condition": {
"functionBody": "return model.devices[arrayIndices].zoneControl >= 1 && model.devices[arrayIndices].zoneControl <= 2;"
},
"required": false
},
"masterMute": {
"title": "Master Mute Control",
"type": "boolean",
"default": false,
"description": "The mute switch for that zone will muted the entire receiver *ON* or *OFF* rather than just the zone itself.",
"condition": {
"functionBody": "return model.devices[arrayIndices].zoneControl >= 1 && model.devices[arrayIndices].zoneControl <= 2;"
},
"required": false
},
"infoButtonCommand": {
"title": "Info Button",
"type": "string",
Expand Down Expand Up @@ -6497,6 +6470,47 @@
"description": "Here select the function of info button in RC.",
"required": true
},
"masterPower": {
"title": "Master Power Control",
"type": "boolean",
"default": false,
"description": "The power switch for that zone will turn the entire receiver *ON* or *OFF/STANDBY* rather than just the zone itself.",
"required": false
},
"masterMute": {
"title": "Master Mute Control",
"type": "boolean",
"default": false,
"description": "The mute switch for that zone will muted the entire receiver *ON* or *OFF* rather than just the zone itself.",
"condition": {
"functionBody": "return model.devices[arrayIndices].zoneControl >= 1 && model.devices[arrayIndices].zoneControl <= 2;"
},
"required": false
},
"masterVolume": {
"title": "Master Volume Control",
"type": "boolean",
"default": false,
"description": "The volume for that zone will set the entire receiver volume *UP* or *DOWN* rather than just the zone itself.",
"condition": {
"functionBody": "return model.devices[arrayIndices].zoneControl >= 1 && model.devices[arrayIndices].zoneControl <= 2;"
},
"required": false
},
"volumeControlNamePrefix": {
"title": "Volume Control Name Prefix",
"type": "boolean",
"default": false,
"description": "Here enable/disable the accessory name as a prefix for volume control name.",
"required": false
},
"volumeControlName": {
"title": "Volume Control Name",
"type": "string",
"placeholder": "Name",
"description": "Here set Your own volume control name or leave empty.",
"required": false
},
"volumeControl": {
"title": "Volume Control Mode",
"type": "integer",
Expand Down Expand Up @@ -6832,6 +6846,18 @@
"type": "tabarray",
"title": "{{ value.title }}",
"items": [
{
"key": "devices[]",
"title": "Volume",
"items": [
"devices[].masterMute",
"devices[].masterVolume",
"devices[].volumeControlNamePrefix",
"devices[].volumeControlName",
"devices[].volumeControl",
"devices[].volumeMax"
]
},
{
"key": "devices[]",
"title": "Sensors",
Expand Down Expand Up @@ -6893,11 +6919,7 @@
"title": "Device",
"items": [
"devices[].masterPower",
"devices[].masterVolume",
"devices[].masterMute",
"devices[].infoButtonCommand",
"devices[].volumeControl",
"devices[].volumeMax",
"devices[].refreshInterval"
]
},
Expand Down
19 changes: 10 additions & 9 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Denon TV",
"name": "homebridge-denon-tv",
"version": "4.13.28",
"version": "4.14.0",
"description": "Homebridge plugin to control Denon/Marantz AV Receivers.",
"license": "MIT",
"author": "grzegorz914",
Expand Down
54 changes: 32 additions & 22 deletions sample-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@
"namePrefix": false
}
],
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"masterPower": false,
"infoButtonCommand": "MNINF",
"masterPower": false,
"volumeControlNamePrefix": false,
"volumeControlName": "Volume",
"volumeControl": 0,
"volumeMax": 0,
"refreshInterval": 5,
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"enableRestFul": false,
"restFulPort": 3000,
"restFulDebug": false,
Expand Down Expand Up @@ -122,17 +124,19 @@
"displayType": 0
}
],
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"infoButtonCommand": "MNINF",
"masterPower": false,
"masterVolume": false,
"masterMute": false,
"infoButtonCommand": "MNINF",
"masterVolume": false,
"volumeControlNamePrefix": false,
"volumeControlName": "Volume",
"volumeControl": 0,
"volumeMax": 0,
"refreshInterval": 5,
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"enableRestFul": false,
"restFulPort": 3001,
"restFulDebug": false,
Expand Down Expand Up @@ -182,17 +186,19 @@
"displayType": 0
}
],
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"infoButtonCommand": "MNINF",
"masterPower": false,
"masterVolume": false,
"masterMute": false,
"infoButtonCommand": "MNINF",
"masterVolume": false,
"volumeControlNamePrefix": false,
"volumeControlName": "Volume",
"volumeControl": 0,
"volumeMax": 0,
"refreshInterval": 5,
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"enableRestFul": false,
"restFulPort": 3002,
"restFulDebug": false,
Expand Down Expand Up @@ -233,15 +239,19 @@
"namePrefix": false
}
],
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"masterPower": false,
"infoButtonCommand": "MNINF",
"masterPower": false,
"masterMute": false,
"masterVolume": false,
"volumeControlNamePrefix": false,
"volumeControlName": "Volume",
"volumeControl": 0,
"volumeMax": 0,
"refreshInterval": 5,
"enableDebugMode": false,
"disableLogInfo": false,
"disableLogDeviceInfo": false,
"disableLogConnectError": false,
"enableRestFul": false,
"restFulPort": 3003,
"restFulDebug": false,
Expand Down
11 changes: 7 additions & 4 deletions src/mainzone.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class MainZone extends EventEmitter {
this.disableLogDeviceInfo = device.disableLogDeviceInfo || false;
this.disableLogConnectError = device.disableLogConnectError || false;
this.infoButtonCommand = device.infoButtonCommand || 'MNINF';
this.volumeControlNamePrefix = device.volumeControlNamePrefix || false;
this.volumeControlName = device.volumeControlName || 'Volume';
this.volumeControl = device.volumeControl || false;
this.volumeMax = device.volumeMax || 100;
this.masterPower = device.masterPower || false;
Expand Down Expand Up @@ -795,10 +797,11 @@ class MainZone extends EventEmitter {
//prepare volume service
if (this.volumeControl) {
const debug = !this.enableDebugMode ? false : this.emit('debug', `Prepare volume service`);
const volumeServiceName = this.volumeControlNamePrefix ? `${accessoryName} ${this.volumeControlName}` : this.volumeControlName;
if (this.volumeControl === 1) {
this.volumeService = accessory.addService(Service.Lightbulb, `${accessoryName} Volume`, 'Volume');
this.volumeService = accessory.addService(Service.Lightbulb, `${volumeServiceName}`, 'Volume');
this.volumeService.addOptionalCharacteristic(Characteristic.ConfiguredName);
this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`);
this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${volumeServiceName}`);
this.volumeService.getCharacteristic(Characteristic.Brightness)
.setProps({
minValue: 0,
Expand All @@ -824,9 +827,9 @@ class MainZone extends EventEmitter {
}

if (this.volumeControl === 2) {
this.volumeServiceFan = accessory.addService(Service.Fan, `${accessoryName} Volume`, 'Volume');
this.volumeServiceFan = accessory.addService(Service.Fan, `${volumeServiceName}`, 'Volume');
this.volumeServiceFan.addOptionalCharacteristic(Characteristic.ConfiguredName);
this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`);
this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${volumeServiceName}`);
this.volumeServiceFan.getCharacteristic(Characteristic.RotationSpeed)
.setProps({
minValue: 0,
Expand Down
11 changes: 7 additions & 4 deletions src/surround.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class Surround extends EventEmitter {
this.disableLogDeviceInfo = device.disableLogDeviceInfo || false;
this.disableLogConnectError = device.disableLogConnectError || false;
this.infoButtonCommand = device.infoButtonCommand || 'MNINF';
this.volumeControlNamePrefix = device.volumeControlNamePrefix || false;
this.volumeControlName = device.volumeControlName || 'Volume';
this.volumeControl = device.volumeControl || false;
this.volumeMax = device.volumeMax || 100;
this.masterPower = device.masterPower || false;
Expand Down Expand Up @@ -702,10 +704,11 @@ class Surround extends EventEmitter {
//prepare volume service
if (this.volumeControl) {
const debug = !this.enableDebugMode ? false : this.emit('debug', `Prepare volume service`);
const volumeServiceName = this.volumeControlNamePrefix ? `${accessoryName} ${this.volumeControlName}` : this.volumeControlName;
if (this.volumeControl === 1) {
this.volumeService = accessory.addService(Service.Lightbulb, `${accessoryName} Volume`, 'Volume');
this.volumeService = accessory.addService(Service.Lightbulb, `${volumeServiceName}`, 'Volume');
this.volumeService.addOptionalCharacteristic(Characteristic.ConfiguredName);
this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`);
this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${volumeServiceName}`);
this.volumeService.getCharacteristic(Characteristic.Brightness)
.setProps({
minValue: 0,
Expand All @@ -731,9 +734,9 @@ class Surround extends EventEmitter {
}

if (this.volumeControl === 2) {
this.volumeServiceFan = accessory.addService(Service.Fan, `${accessoryName} Volume`, 'Volume');
this.volumeServiceFan = accessory.addService(Service.Fan, `${volumeServiceName}`, 'Volume');
this.volumeServiceFan.addOptionalCharacteristic(Characteristic.ConfiguredName);
this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`);
this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${volumeServiceName}`);
this.volumeServiceFan.getCharacteristic(Characteristic.RotationSpeed)
.setProps({
minValue: 0,
Expand Down
Loading

0 comments on commit c2d72fb

Please sign in to comment.