homebridge-denon-tv 4.3.7 → 4.3.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/denondevice.js +19 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Denon TV",
3
3
  "name": "homebridge-denon-tv",
4
- "version": "4.3.7",
4
+ "version": "4.3.9",
5
5
  "description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Denon/Marantz AV Receivers.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -503,8 +503,25 @@ class DenonDevice extends EventEmitter {
503
503
  const zone = [inputMode, 'Z2', 'Z3', inputMode][zoneControl];
504
504
  const reference = zone + inputReference;
505
505
 
506
- await this.denon.send(reference);
507
- const info = this.disableLogInfo ? false : this.emit('message', `set ${this.inputSurround} Name: ${inputName}, Reference: ${inputReference}`);
506
+ switch (this.power) {
507
+ case false:
508
+ this.inputSet = false;
509
+
510
+ setInterval(async () => {
511
+ if (this.inputSet) {
512
+ return;
513
+ }
514
+
515
+ const setInput = this.power ? await this.denon.send(reference) : false;
516
+ this.inputSet = this.power;
517
+ const info = this.disableLogInfo || !this.power ? false : this.emit('message', `set ${this.inputSurround} Name: ${inputName}, Reference: ${inputReference}`);
518
+ }, 2000);
519
+ break;
520
+ case true:
521
+ await this.denon.send(reference);
522
+ const info = this.disableLogInfo ? false : this.emit('message', `set ${this.inputSurround} Name: ${inputName}, Reference: ${inputReference}`);
523
+ break;
524
+ }
508
525
  } catch (error) {
509
526
  this.emit('error', `set ${this.inputSurround} error: ${error}`);
510
527
  };