iobroker.denon 1.15.3 → 1.15.5

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018-2022 Moritz Heusinger <moritz.heusinger@gmail.com>
3
+ Copyright (c) 2018-2024 Moritz Heusinger <moritz.heusinger@gmail.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -908,6 +908,12 @@ The adapter is tested with an DENON AVR-X1200W and a Marantz SR5009.
908
908
  Placeholder for the next version (at the beginning of the line):
909
909
  ### __WORK IN PROGRESS__
910
910
  -->
911
+ ### 1.15.5 (2024-01-06)
912
+ * (foxriver76) fixed issue on setting tuner frequency (closes #328)
913
+
914
+ ### 1.15.4 (2023-08-19)
915
+ * (foxriver76) fixed detection of display content if content does not contain `NULL` (closes #323)
916
+
911
917
  ### 1.15.3 (2023-07-13)
912
918
  * (foxriver76) fixed log entry when setting channel volume states (closes #321)
913
919
 
@@ -1204,7 +1210,7 @@ The adapter is tested with an DENON AVR-X1200W and a Marantz SR5009.
1204
1210
  ## License
1205
1211
  The MIT License (MIT)
1206
1212
 
1207
- Copyright (c) 2018-2022 Moritz Heusinger <moritz.heusinger@gmail.com>
1213
+ Copyright (c) 2018-2024 Moritz Heusinger <moritz.heusinger@gmail.com>
1208
1214
 
1209
1215
  Permission is hereby granted, free of charge, to any person obtaining a copy
1210
1216
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,3 @@
1
- /// <reference types="iobroker" />
2
1
  export declare const commonCommands: ioBroker.AnyObject[];
3
2
  export declare const usCommandsZone: ioBroker.StateObject[];
4
3
  export declare const usCommands: ioBroker.StateObject[];
package/build/main.js CHANGED
@@ -309,10 +309,9 @@ class Denon extends utils.Adapter {
309
309
  });
310
310
  this.client.on('data', data => {
311
311
  // split data by <cr>
312
- const dataArr = data.toString().split(/[\r\n]+/); // Split by Carriage Return
312
+ const dataArr = data.toString().split(/[\r\n]+/);
313
313
  for (const data of dataArr) {
314
314
  if (data) {
315
- // data not empty
316
315
  this.log.debug(`[DATA] <== Incoming data: ${data}`);
317
316
  this.handleResponse(data);
318
317
  }
@@ -706,7 +705,7 @@ class Denon extends utils.Adapter {
706
705
  break;
707
706
  case 'tuner.frequency': {
708
707
  // remove the dot from 106.90
709
- let strFreq = state.toString().replace('.', '');
708
+ let strFreq = stateVal.toString().replace('.', '');
710
709
  if (strFreq.length < 6 && stateVal < 1000) {
711
710
  // below 1000 we need leading zero
712
711
  strFreq = `0${strFreq}`;
@@ -1400,7 +1399,7 @@ class Denon extends utils.Adapter {
1400
1399
  /**
1401
1400
  * Handle single response from AVR
1402
1401
  *
1403
- * @param data
1402
+ * @param data single data line
1404
1403
  */
1405
1404
  async handleResponse(data) {
1406
1405
  if (!this.pollTimer) {
@@ -1418,33 +1417,10 @@ class Denon extends utils.Adapter {
1418
1417
  }
1419
1418
  // Detect receiver type --> first poll is SV? and SV00?
1420
1419
  if (!this.receiverType) {
1421
- if (data.startsWith('SV') || /^MV\d+/g.test(data)) {
1422
- if (/^SV[\d]+/g.test(data)) {
1423
- this.receiverType = 'US';
1424
- await this.createStandardStates('US');
1425
- this.log.debug('[UPDATE] Updating states');
1426
- return void this.updateStates(); // Update states when connected
1427
- }
1428
- else {
1429
- this.receiverType = 'DE';
1430
- await this.createStandardStates('DE');
1431
- this.log.debug('[UPDATE] Updating states');
1432
- return void this.updateStates();
1433
- }
1434
- }
1435
- else if (data.startsWith('BDSTATUS')) {
1436
- // DENON Ceol Piccolo protocol detected , but we handle it as DE
1437
- this.receiverType = 'DE';
1438
- await this.createStandardStates('DE');
1439
- this.log.debug('[UPDATE] Updating states');
1440
- return void this.updateStates();
1441
- }
1442
- else {
1443
- return;
1444
- } // return if remote command received before response to SV (receiverCheck)
1420
+ return this.determineReceiverType(data);
1445
1421
  }
1446
1422
  else if (this.receiverType === 'US') {
1447
- return void this.handleUsResponse(data);
1423
+ return this.handleUsResponse(data);
1448
1424
  }
1449
1425
  // get command out of String
1450
1426
  let command;
@@ -1540,7 +1516,8 @@ class Denon extends utils.Adapter {
1540
1516
  // on older models it sometimes sends just NSE for unknown reasons - ignore it
1541
1517
  return;
1542
1518
  }
1543
- const displayCont = data.substring(4, data.indexOf('\0')).replace(/[\1\2]/g, ''); // Remove all STX, SOH, NULL
1519
+ // Remove all STX, SOH, NULL
1520
+ const displayCont = (data.includes('\0') ? data.substring(4, data.indexOf('\0')) : data.substring(4)).replace(/[\1\2]/g, '');
1544
1521
  const dispContNr = data.slice(3, 4);
1545
1522
  if (!this.capabilities.display) {
1546
1523
  await this.createDisplayAndHttp();
@@ -1860,6 +1837,38 @@ class Denon extends utils.Adapter {
1860
1837
  this.log.debug(`[INFO] <== Unhandled command ${command}`);
1861
1838
  }
1862
1839
  }
1840
+ /**
1841
+ * Handle single response from AVR
1842
+ *
1843
+ * @param data single data line
1844
+ */
1845
+ async determineReceiverType(data) {
1846
+ if (data.startsWith('SV') || /^MV\d+/g.test(data)) {
1847
+ if (/^SV[\d]+/g.test(data)) {
1848
+ this.receiverType = 'US';
1849
+ await this.createStandardStates('US');
1850
+ this.log.debug('[UPDATE] Updating states');
1851
+ return void this.updateStates(); // Update states when connected
1852
+ }
1853
+ else {
1854
+ this.receiverType = 'DE';
1855
+ await this.createStandardStates('DE');
1856
+ this.log.debug('[UPDATE] Updating states');
1857
+ return void this.updateStates();
1858
+ }
1859
+ }
1860
+ else if (data.startsWith('BDSTATUS')) {
1861
+ // DENON Ceol Piccolo protocol detected , but we handle it as DE
1862
+ this.receiverType = 'DE';
1863
+ await this.createStandardStates('DE');
1864
+ this.log.debug('[UPDATE] Updating states');
1865
+ return void this.updateStates();
1866
+ }
1867
+ else {
1868
+ // return if remote command received before response to SV (receiverCheck)
1869
+ return;
1870
+ }
1871
+ }
1863
1872
  /**
1864
1873
  * Create all zone specific objects for given zone
1865
1874
  *
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "denon",
4
- "version": "1.15.3",
4
+ "version": "1.15.5",
5
5
  "news": {
6
+ "1.15.5": {
7
+ "en": "fixed issue on setting tuner frequency (closes #328)",
8
+ "de": "feste ausgabe zur einstellung der thunfischfrequenz (geschlossen #328)",
9
+ "ru": "фиксированный вопрос о настройке частоты тюнеров (закрывает #328)",
10
+ "pt": "problema fixo na definição de frequência de sintonizador (fecha #328)",
11
+ "nl": "vast probleem bij het instellen van tunerfrequentie (sluit #328)",
12
+ "fr": "problème fixe sur la fréquence de réglage du tuner (ferme #328)",
13
+ "it": "problema fisso sulla regolazione della frequenza del sintonizzatore (chiude #328)",
14
+ "es": "edición fija en la frecuencia de ajuste (cerca #328)",
15
+ "pl": "stały problem przy ustawianiu częstotliwości tunera (zamyka # 328)",
16
+ "uk": "виправлено проблему на встановлення частоти тюнера (закривається no328)",
17
+ "zh-cn": "设定调制器频率的固定期( 关闭 # 328)"
18
+ },
19
+ "1.15.4": {
20
+ "en": "fixed detection of display content if content does not contain `NULL` (closes #323)",
21
+ "de": "feste Erkennung von Anzeigeinhalten, wenn Inhalt NULL nicht enthält (schließt #323)",
22
+ "ru": "фиксированное обнаружение содержимого дисплея, если содержимое не содержит NULL (заметки #323)",
23
+ "pt": "detecção fixa de conteúdo de exibição se o conteúdo não contém NULL (fecha #323)",
24
+ "nl": "vertaling:",
25
+ "fr": "détection fixe de contenu d'affichage si le contenu ne contient pas de NULL (ferme #323)",
26
+ "it": "rilevamento fisso del contenuto di visualizzazione se il contenuto non contiene NULL (chiude #323)",
27
+ "es": "detección fija de contenido de pantalla si el contenido no contiene NULL (cerca #323)",
28
+ "pl": "ostateczne wykrywanie treści nie zawiera NULL (oznaczenie #323)",
29
+ "uk": "фіксоване виявлення вмісту дисплея, якщо вміст не містить NULL (закриває #323)",
30
+ "zh-cn": "如果内容不包含NULL(编号:第323号)的固定识别显示内容"
31
+ },
6
32
  "1.15.3": {
7
33
  "en": "fixed log entry when setting channel volume states (closes #321)",
8
34
  "de": "fester log-eintrag beim einstellen von kanalvolumenzuständen (schließt #321)",
@@ -67,30 +93,6 @@
67
93
  "pl": "port\nrzeczywiste problemy z dekodowaniem stanów wejściowych",
68
94
  "uk": "портфоліо\nвиправлені питання з декодуванням вхідного стану",
69
95
  "zh-cn": "港口\na. 固定问题,有投入的国家"
70
- },
71
- "1.13.4": {
72
- "en": "we now respect `requestInterval` on determining the AVR model too",
73
- "de": "Wir berücksichtigen jetzt auch `requestInterval` bei der Bestimmung des AVR-Modells",
74
- "ru": "теперь мы учитываем `requestInterval` и при определении модели AVR.",
75
- "pt": "agora respeitamos `requestInterval` na determinação do modelo AVR também",
76
- "nl": "we respecteren nu ook `requestInterval` bij het bepalen van het AVR-model",
77
- "fr": "nous respectons maintenant `requestInterval` lors de la détermination du modèle AVR également",
78
- "it": "ora rispettiamo anche `requestInterval` nel determinare il modello AVR",
79
- "es": "ahora respetamos `requestInterval` al determinar el modelo AVR también",
80
- "pl": "teraz szanujemy również „requestInterval” przy określaniu modelu AVR",
81
- "zh-cn": "我们现在在确定 AVR 模型时也尊重`requestInterval`"
82
- },
83
- "1.13.3": {
84
- "en": "fixed timeout beeing only applied on first reconnect (fixes #232)",
85
- "de": "Behobenes Timeout, das nur beim ersten Reconnect angewendet wird (Fixes Nr. 232)",
86
- "ru": "фиксированный тайм-аут применяется только при первом повторном подключении (исправления № 232)",
87
- "pt": "tempo limite fixo sendo aplicado apenas na primeira reconexão (correções #232)",
88
- "nl": "vaste time-out wordt alleen toegepast bij de eerste keer opnieuw verbinden (fixt #232)",
89
- "fr": "le délai d'attente fixe n'est appliqué qu'à la première reconnexion (corrections #232)",
90
- "it": "timeout fisso applicato solo alla prima riconnessione (correzioni n. 232)",
91
- "es": "el tiempo de espera fijo solo se aplica en la primera reconexión (correcciones # 232)",
92
- "pl": "naprawiony limit czasu stosowany tylko przy pierwszym ponownym połączeniu (poprawki #232)",
93
- "zh-cn": "固定超时蜂鸣仅适用于第一次重新连接(修复#232)"
94
96
  }
95
97
  },
96
98
  "title": "DENON AVR",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.denon",
3
- "version": "1.15.3",
3
+ "version": "1.15.5",
4
4
  "engines": {
5
5
  "node": ">=14.0.0"
6
6
  },
@@ -30,23 +30,24 @@
30
30
  "url": "https://github.com/foxriver76/ioBroker.denon"
31
31
  },
32
32
  "dependencies": {
33
- "@iobroker/adapter-core": "^2.6.7",
33
+ "@iobroker/adapter-core": "^3.0.4",
34
34
  "@types/mocha": "^10.0.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@alcalzone/release-script": "^3.5.6",
38
38
  "@alcalzone/release-script-plugin-iobroker": "^3.5.7",
39
39
  "@iobroker/testing": "^4.1.0",
40
+ "@iobroker/types": "^5.0.17",
40
41
  "@typescript-eslint/eslint-plugin": "^5.48.0",
41
42
  "@typescript-eslint/parser": "^5.48.0",
42
43
  "axios": "^0.26.1",
43
44
  "chai": "^4.3.6",
44
- "eslint": "^8.13.0",
45
- "eslint-config-prettier": "^8.5.0",
46
- "eslint-plugin-prettier": "^4.0.0",
45
+ "eslint": "^8.47.0",
46
+ "eslint-config-prettier": "^9.0.0",
47
+ "eslint-plugin-prettier": "^5.0.0",
47
48
  "gulp": "^4.0.2",
48
49
  "mocha": "^9.2.2",
49
- "prettier": "^2.6.2",
50
+ "prettier": "^3.0.2",
50
51
  "ts-node": "^10.9.1",
51
52
  "typescript": "^4.9.4"
52
53
  },