From 0fe32c23be6e41470712cee516be1cd24a38a146 Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Sun, 21 Apr 2024 10:49:56 +0200 Subject: [PATCH] release 4.13.0 --- CHANGELOG.md | 6 ++++++ README.md | 1 + config.schema.json | 10 ++++++++++ package.json | 2 +- sample-config.json | 4 ++++ src/mainzone.js | 13 +++++++++++++ src/surround.js | 13 +++++++++++++ src/zone2.js | 13 +++++++++++++ src/zone3.js | 13 +++++++++++++ 9 files changed, 74 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d796735..838e0c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ 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.13.0] - (21.04.2024) +## Changes +- added possibility to set max volume for slider, fan, and speaker +- config schema updated +- cleanup + ## [4.12.0] - (04.04.2024) ## Changes - remove unused master volume and mute control for main zone and surround diff --git a/README.md b/README.md index e67da7f..e6b2718 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ Tested Denon AVR-2112CI, AVR-3311CI, AVR-X6300H, AVR-X2700H, AVC-X4800H, Marantz | `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). | | `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. | | `enableRestFul` | If enabled, RESTful server will start automatically and respond to any path request. | diff --git a/config.schema.json b/config.schema.json index 032366b..71d929b 100644 --- a/config.schema.json +++ b/config.schema.json @@ -6246,6 +6246,15 @@ ], "required": true }, + "volumeMax": { + "title": "Max Volume (%)", + "type": "integer", + "default": 100, + "minimum": 0, + "maximum": 100, + "description": "Here set the max possible volume to set.", + "required": true + }, "refreshInterval": { "title": "Refresh interval (sec)", "type": "integer", @@ -6579,6 +6588,7 @@ "devices[].masterMute", "devices[].infoButtonCommand", "devices[].volumeControl", + "devices[].volumeMax", "devices[].refreshInterval" ] }, diff --git a/package.json b/package.json index 3dae4d0..3099956 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Denon TV", "name": "homebridge-denon-tv", - "version": "4.12.10", + "version": "4.13.0", "description": "Homebridge plugin to control Denon/Marantz AV Receivers.", "license": "MIT", "author": "grzegorz914", diff --git a/sample-config.json b/sample-config.json index 23433c6..e18cbb8 100644 --- a/sample-config.json +++ b/sample-config.json @@ -71,6 +71,7 @@ "masterPower": false, "infoButtonCommand": "MNINF", "volumeControl": 0, + "volumeMax": 0, "refreshInterval": 5, "enableRestFul": false, "restFulPort": 3000, @@ -130,6 +131,7 @@ "masterMute": false, "infoButtonCommand": "MNINF", "volumeControl": 0, + "volumeMax": 0, "refreshInterval": 5, "enableRestFul": false, "restFulPort": 3001, @@ -189,6 +191,7 @@ "masterMute": false, "infoButtonCommand": "MNINF", "volumeControl": 0, + "volumeMax": 0, "refreshInterval": 5, "enableRestFul": false, "restFulPort": 3002, @@ -237,6 +240,7 @@ "masterPower": false, "infoButtonCommand": "MNINF", "volumeControl": 0, + "volumeMax": 0, "refreshInterval": 5, "enableRestFul": false, "restFulPort": 3003, diff --git a/src/mainzone.js b/src/mainzone.js index 942a5ee..19fe7ea 100644 --- a/src/mainzone.js +++ b/src/mainzone.js @@ -35,6 +35,7 @@ class MainZone extends EventEmitter { this.disableLogConnectError = device.disableLogConnectError || false; this.infoButtonCommand = device.infoButtonCommand || 'MNINF'; this.volumeControl = device.volumeControl || false; + this.volumeMax = device.volumeMax || 100; this.masterPower = device.masterPower || false; //external integration @@ -628,6 +629,10 @@ class MainZone extends EventEmitter { }); this.tvSpeakerService.getCharacteristic(Characteristic.Volume) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; @@ -758,6 +763,10 @@ class MainZone extends EventEmitter { this.volumeService.addOptionalCharacteristic(Characteristic.ConfiguredName); this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`); this.volumeService.getCharacteristic(Characteristic.Brightness) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; @@ -782,6 +791,10 @@ class MainZone extends EventEmitter { this.volumeServiceFan.addOptionalCharacteristic(Characteristic.ConfiguredName); this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`); this.volumeServiceFan.getCharacteristic(Characteristic.RotationSpeed) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; diff --git a/src/surround.js b/src/surround.js index 13a5a76..5fa0079 100644 --- a/src/surround.js +++ b/src/surround.js @@ -35,6 +35,7 @@ class Surround extends EventEmitter { this.disableLogConnectError = device.disableLogConnectError || false; this.infoButtonCommand = device.infoButtonCommand || 'MNINF'; this.volumeControl = device.volumeControl || false; + this.volumeMax = device.volumeMax || 100; this.masterPower = device.masterPower || false; //external integration @@ -559,6 +560,10 @@ class Surround extends EventEmitter { }); this.tvSpeakerService.getCharacteristic(Characteristic.Volume) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; @@ -689,6 +694,10 @@ class Surround extends EventEmitter { this.volumeService.addOptionalCharacteristic(Characteristic.ConfiguredName); this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`); this.volumeService.getCharacteristic(Characteristic.Brightness) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; @@ -713,6 +722,10 @@ class Surround extends EventEmitter { this.volumeServiceFan.addOptionalCharacteristic(Characteristic.ConfiguredName); this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`); this.volumeServiceFan.getCharacteristic(Characteristic.RotationSpeed) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; diff --git a/src/zone2.js b/src/zone2.js index f19b361..7d56ef5 100644 --- a/src/zone2.js +++ b/src/zone2.js @@ -35,6 +35,7 @@ class Zone2 extends EventEmitter { this.disableLogConnectError = device.disableLogConnectError || false; this.infoButtonCommand = device.infoButtonCommand || 'MNINF'; this.volumeControl = device.volumeControl || false; + this.volumeMax = device.volumeMax || 100; this.masterPower = device.masterPower || false; this.masterVolume = device.masterVolume || false; this.masterMute = device.masterMute || false; @@ -546,6 +547,10 @@ class Zone2 extends EventEmitter { }); this.tvSpeakerService.getCharacteristic(Characteristic.Volume) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; @@ -676,6 +681,10 @@ class Zone2 extends EventEmitter { this.volumeService.addOptionalCharacteristic(Characteristic.ConfiguredName); this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`); this.volumeService.getCharacteristic(Characteristic.Brightness) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; @@ -700,6 +709,10 @@ class Zone2 extends EventEmitter { this.volumeServiceFan.addOptionalCharacteristic(Characteristic.ConfiguredName); this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`); this.volumeServiceFan.getCharacteristic(Characteristic.RotationSpeed) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; diff --git a/src/zone3.js b/src/zone3.js index 0d4d402..551a45f 100644 --- a/src/zone3.js +++ b/src/zone3.js @@ -35,6 +35,7 @@ class Zone3 extends EventEmitter { this.disableLogConnectError = device.disableLogConnectError || false; this.infoButtonCommand = device.infoButtonCommand || 'MNINF'; this.volumeControl = device.volumeControl || false; + this.volumeMax = device.volumeMax || 100; this.masterPower = device.masterPower || false; this.masterVolume = device.masterVolume || false; this.masterMute = device.masterMute || false; @@ -546,6 +547,10 @@ class Zone3 extends EventEmitter { }); this.tvSpeakerService.getCharacteristic(Characteristic.Volume) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; @@ -676,6 +681,10 @@ class Zone3 extends EventEmitter { this.volumeService.addOptionalCharacteristic(Characteristic.ConfiguredName); this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`); this.volumeService.getCharacteristic(Characteristic.Brightness) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume; @@ -700,6 +709,10 @@ class Zone3 extends EventEmitter { this.volumeServiceFan.addOptionalCharacteristic(Characteristic.ConfiguredName); this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`); this.volumeServiceFan.getCharacteristic(Characteristic.RotationSpeed) + .setProps({ + minValue: 0, + maxValue: this.volumeMax + }) .onGet(async () => { const volume = this.volume; return volume;