homebridge-denon-tv 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Denon TV",
3
3
  "name": "homebridge-denon-tv",
4
- "version": "4.2.1",
4
+ "version": "4.2.2",
5
5
  "description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Denon/Marantz AV Receivers.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -708,13 +708,8 @@ class DenonDevice extends EventEmitter {
708
708
  })
709
709
  .onSet(async (value) => {
710
710
  try {
711
+ value = (value === 0 || value === 100) ? this.volume : (value < 10 ? `0${value}` : value);
711
712
  const masterControl = this.masterVolume ? 0 : zoneControl;
712
- if (value === 0 || value === 100) {
713
- value = this.volume < 10 ? `0${this.volume}` : this.volume;
714
- } else if (value < 10) {
715
- value = `0${volume}`;
716
- }
717
-
718
713
  const volume = [`MV${value}`, `Z2${value}`, `Z3${value}`, `MV${value}`][masterControl];
719
714
  await this.denon.send(volume);
720
715
  const info = this.disableLogInfo ? false : this.emit('message', `set Volume: ${value - 80}`);