homebridge-denon-tv 5.4.2 → 5.4.3

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/CHANGELOG.md CHANGED
@@ -12,7 +12,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
12
  - after update to 4.7.x buttons, sensors, volume display type need to be configure again using config UI
13
13
  - after update to 3.15.x need remove the accessory frome Home app and add it again
14
14
 
15
- ## [5.4.2] - (02.06.2025)
15
+ ## [5.4.3] - (07.02.2025)
16
+
17
+ ## Changes
18
+
19
+ - stability and improvements
20
+
21
+ ## [5.4.2] - (06.02.2025)
16
22
 
17
23
  ## Changes
18
24
 
package/index.js CHANGED
@@ -118,6 +118,9 @@ class DenonPlatform {
118
118
  try {
119
119
  const startDone = await mainZone.start();
120
120
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
121
+
122
+ //start device impulse generator
123
+ const startImpulseGenerator = startDone ? await mainZone.startImpulseGenerator() : false;
121
124
  } catch (error) {
122
125
  const emitLog = disableLogError ? false : log.error(`Device: ${host} ${deviceName}, ${error}, trying again.`);
123
126
  };
@@ -163,6 +166,9 @@ class DenonPlatform {
163
166
  try {
164
167
  const startDone = await zone2.start();
165
168
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
169
+
170
+ //start device impulse generator
171
+ const startImpulseGenerator = startDone ? await zone2.startImpulseGenerator() : false;
166
172
  } catch (error) {
167
173
  const emitLog = disableLogError ? false : log.error(`Device: ${host} ${deviceName}, ${error}, trying again.`);
168
174
  };
@@ -208,6 +214,9 @@ class DenonPlatform {
208
214
  try {
209
215
  const startDone = await zone3.start();
210
216
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
217
+
218
+ //start device impulse generator
219
+ const startImpulseGenerator = startDone ? await zone3.startImpulseGenerator() : false;
211
220
  } catch (error) {
212
221
  const emitLog = disableLogError ? false : log.error(`Device: ${host} ${deviceName}, ${error}, trying again.`);
213
222
  };
@@ -253,6 +262,9 @@ class DenonPlatform {
253
262
  try {
254
263
  const startDone = await surround.start();
255
264
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
265
+
266
+ //start device impulse generator
267
+ const startImpulseGenerator = startDone ? await surround.startImpulseGenerator() : false;
256
268
  } catch (error) {
257
269
  const emitLog = disableLogError ? false : log.error(`Device: ${host} ${deviceName}, ${error}, trying again.`);
258
270
  };
@@ -298,6 +310,9 @@ class DenonPlatform {
298
310
  try {
299
311
  const startDone = await passThroughInputs.start();
300
312
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
313
+
314
+ //start device impulse generator
315
+ const startImpulseGenerator = startDone ? await passThroughInputs.startImpulseGenerator() : false;
301
316
  } catch (error) {
302
317
  const emitLog = disableLogError ? false : log.error(`Device: ${host} ${deviceName}, ${error}, trying again.`);
303
318
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Denon TV",
3
3
  "name": "homebridge-denon-tv",
4
- "version": "5.4.2",
4
+ "version": "5.4.3",
5
5
  "description": "Homebridge plugin to control Denon/Marantz AV Receivers.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/mainzone.js CHANGED
@@ -315,6 +315,16 @@ class MainZone extends EventEmitter {
315
315
  }
316
316
  }
317
317
 
318
+ async startImpulseGenerator() {
319
+ try {
320
+ //start impulse generator
321
+ await this.denon.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
322
+ return true;
323
+ } catch (error) {
324
+ throw new Error(`Impulse generator start error: ${error}`);
325
+ };
326
+ }
327
+
318
328
  async scaleValue(value, inMin, inMax, outMin, outMax) {
319
329
  const scaledValue = parseFloat((((Math.max(inMin, Math.min(inMax, value)) - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin).toFixed(0));
320
330
  return scaledValue;
@@ -1074,9 +1084,6 @@ class MainZone extends EventEmitter {
1074
1084
  const accessory = await this.prepareAccessory();
1075
1085
  this.emit('publishAccessory', accessory);
1076
1086
  this.startPrepareAccessory = false;
1077
-
1078
- //start impulse generator
1079
- await this.denon.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
1080
1087
  }
1081
1088
 
1082
1089
  return true;
@@ -136,6 +136,16 @@ class MainZone extends EventEmitter {
136
136
  };
137
137
  }
138
138
 
139
+ async startImpulseGenerator() {
140
+ try {
141
+ //start impulse generator
142
+ await this.denon.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
143
+ return true;
144
+ } catch (error) {
145
+ throw new Error(`Impulse generator start error: ${error}`);
146
+ };
147
+ }
148
+
139
149
  async prepareDataForAccessory() {
140
150
  try {
141
151
  //read inputs file
@@ -525,9 +535,6 @@ class MainZone extends EventEmitter {
525
535
  const accessory = await this.prepareAccessory();
526
536
  this.emit('publishAccessory', accessory);
527
537
  this.startPrepareAccessory = false;
528
-
529
- //start impulse generator
530
- await this.denon.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
531
538
  }
532
539
 
533
540
  return true;
package/src/surround.js CHANGED
@@ -160,6 +160,16 @@ class Surround extends EventEmitter {
160
160
  };
161
161
  }
162
162
 
163
+ async startImpulseGenerator() {
164
+ try {
165
+ //start impulse generator
166
+ await this.denon.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
167
+ return true;
168
+ } catch (error) {
169
+ throw new Error(`Impulse generator start error: ${error}`);
170
+ };
171
+ }
172
+
163
173
  //prepare accessory
164
174
  async prepareAccessory() {
165
175
  try {
@@ -534,9 +544,6 @@ class Surround extends EventEmitter {
534
544
  const accessory = await this.prepareAccessory();
535
545
  this.emit('publishAccessory', accessory);
536
546
  this.startPrepareAccessory = false;
537
-
538
- //start impulse generator
539
- await this.denon.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
540
547
  }
541
548
 
542
549
  return true;
package/src/zone2.js CHANGED
@@ -319,6 +319,16 @@ class Zone2 extends EventEmitter {
319
319
  };
320
320
  }
321
321
 
322
+ async startImpulseGenerator() {
323
+ try {
324
+ //start impulse generator
325
+ await this.denon.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
326
+ return true;
327
+ } catch (error) {
328
+ throw new Error(`Impulse generator start error: ${error}`);
329
+ };
330
+ }
331
+
322
332
  async scaleValue(value, inMin, inMax, outMin, outMax) {
323
333
  const scaledValue = parseFloat((((Math.max(inMin, Math.min(inMax, value)) - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin).toFixed(0));
324
334
  return scaledValue;
@@ -987,9 +997,6 @@ class Zone2 extends EventEmitter {
987
997
  const accessory = await this.prepareAccessory();
988
998
  this.emit('publishAccessory', accessory);
989
999
  this.startPrepareAccessory = false;
990
-
991
- //start impulse generator
992
- await this.denon.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
993
1000
  }
994
1001
 
995
1002
  return true;
package/src/zone3.js CHANGED
@@ -319,6 +319,16 @@ class Zone3 extends EventEmitter {
319
319
  };
320
320
  }
321
321
 
322
+ async startImpulseGenerator() {
323
+ try {
324
+ //start impulse generator
325
+ await this.denon.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
326
+ return true;
327
+ } catch (error) {
328
+ throw new Error(`Impulse generator start error: ${error}`);
329
+ };
330
+ }
331
+
322
332
  async scaleValue(value, inMin, inMax, outMin, outMax) {
323
333
  const scaledValue = parseFloat((((Math.max(inMin, Math.min(inMax, value)) - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin).toFixed(0));
324
334
  return scaledValue;
@@ -986,9 +996,6 @@ class Zone3 extends EventEmitter {
986
996
  const accessory = await this.prepareAccessory();
987
997
  this.emit('publishAccessory', accessory);
988
998
  this.startPrepareAccessory = false;
989
-
990
- //start impulse generator
991
- await this.denon.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
992
999
  }
993
1000
 
994
1001
  return true;