Skip to content

Commit

Permalink
PollingTime and TimeOUT changed to type number
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe1958 committed Oct 5, 2024
1 parent 8381160 commit 20c91ec
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Change Volume (triggered by changing '.control.volume')

### **WORK IN PROGRESS**

- (Uwe Nagel) PollingTime and TimeOUT changed to type number
- (Uwe Nagel) onReady() stopped when no IP is set
- (Uwe Nagel) Testing extended to node 22.x
- (Uwe Nagel) Example code removed
Expand Down
4 changes: 2 additions & 2 deletions admin/i18n/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"Toggles Pause": "Schaltet Pause um",
"Current player state": "Aktueller Spielerstatus",
"IP or hostname of Device": "IP oder Hostname des Geräts",
"Pollinginterval [msec]": "Abfrageintervall [ms]",
"Timeout for API calls [msec]": "Timeout für API-Aufrufe [ms]"
"Pollinginterval [sec]": "Abfrageintervall [sec]",
"Timeout for API calls [sec]": "Timeout für API-Aufrufe [sec]"
}
4 changes: 2 additions & 2 deletions admin/i18n/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"Toggles Pause": "Toggles Pause",
"Current player state": "Current player state",
"IP or hostname of Device": "IP or hostname of Device",
"Pollinginterval [msec]": "Pollinginterval [msec]",
"Timeout for API calls [msec]": "Timeout for API calls [msec]"
"Pollinginterval [sec]": "Pollinginterval [sec]",
"Timeout for API calls [sec]": "Timeout for API calls [sec]"
}
4 changes: 2 additions & 2 deletions admin/i18n/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"Toggles Pause": "Alterna pausa",
"Current player state": "Estado actual del jugador",
"IP or hostname of Device": "IP o nombre de host del dispositivo",
"Pollinginterval [msec]": "Intervalo de sondeo [mseg]",
"Timeout for API calls [msec]": "Tiempo de espera para llamadas API [mseg]"
"Pollinginterval [sec]": "Intervalo de sondeo [seg]",
"Timeout for API calls [sec]": "Tiempo de espera para llamadas API [seg]"
}
4 changes: 2 additions & 2 deletions admin/i18n/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"Toggles Pause": "Active/désactive la pause",
"Current player state": "État actuel du joueur",
"IP or hostname of Device": "IP ou nom d'hôte de l'appareil",
"Pollinginterval [msec]": "Intervalle d'interrogation [msec]",
"Timeout for API calls [msec]": "Délai d'expiration pour les appels d'API [msec]"
"Pollinginterval [sec]": "Intervalle d'interrogation [sec]",
"Timeout for API calls [sec]": "Délai d'expiration pour les appels d'API [sec]"
}
4 changes: 2 additions & 2 deletions admin/i18n/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"Toggles Pause": "Attiva/disattiva la pausa",
"Current player state": "Stato attuale del giocatore",
"IP or hostname of Device": "IP o nome host del dispositivo",
"Pollinginterval [msec]": "Intervallo di polling [msec]",
"Timeout for API calls [msec]": "Timeout per le chiamate API [msec]"
"Pollinginterval [sec]": "Intervallo di polling [sec]",
"Timeout for API calls [sec]": "Timeout per le chiamate API [sec]"
}
4 changes: 2 additions & 2 deletions admin/i18n/nl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"Toggles Pause": "Schakelt tussen pauzeren",
"Current player state": "Huidige spelerstatus",
"IP or hostname of Device": "IP of hostnaam van apparaat",
"Pollinginterval [msec]": "Pollinginterval [msec]",
"Timeout for API calls [msec]": "Time-out voor API-aanroepen [msec]"
"Pollinginterval [sec]": "Pollinginterval [sec]",
"Timeout for API calls [sec]": "Time-out voor API-aanroepen [sec]"
}
4 changes: 2 additions & 2 deletions admin/i18n/pl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"Toggles Pause": "Przełącza pauzę",
"Current player state": "Aktualny stan gracza",
"IP or hostname of Device": "Adres IP lub nazwa hosta Urządzenia",
"Pollinginterval [msec]": "Interwał odpytywania [ms]",
"Timeout for API calls [msec]": "Limit czasu dla wywołań API [ms]"
"Pollinginterval [sec]": "Interwał odpytywania [s]",
"Timeout for API calls [sec]": "Limit czasu dla wywołań API [s]"
}
4 changes: 2 additions & 2 deletions admin/i18n/pt/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"Toggles Pause": "Alterna pausa",
"Current player state": "Estado atual do jogador",
"IP or hostname of Device": "IP ou nome de host do dispositivo",
"Pollinginterval [msec]": "Intervalo de pesquisa [ms]",
"Timeout for API calls [msec]": "Tempo limite para chamadas de API [ms]"
"Pollinginterval [sec]": "Intervalo de pesquisa [s]",
"Timeout for API calls [sec]": "Tempo limite para chamadas de API [s]"
}
4 changes: 2 additions & 2 deletions admin/i18n/uk/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"Toggles Pause": "Перемикає паузу",
"Current player state": "Поточний стан гравця",
"IP or hostname of Device": "IP або ім’я хоста пристрою",
"Pollinginterval [msec]": "Інтервал опитування [мс]",
"Timeout for API calls [msec]": "Тайм-аут для викликів API [мс]"
"Pollinginterval [sec]": "Інтервал опитування [с]",
"Timeout for API calls [sec]": "Тайм-аут для викликів API [с]"
}
4 changes: 2 additions & 2 deletions admin/i18n/zh-cn/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"Toggles Pause": "切换暂停",
"Current player state": "当前玩家状态",
"IP or hostname of Device": "设备的 IP 或主机名",
"Pollinginterval [msec]": "轮询间隔 [毫秒]",
"Timeout for API calls [msec]": "API 调用超时 [毫秒]"
"Pollinginterval [sec]": "轮询间隔 []",
"Timeout for API calls [sec]": "API 调用超时 []"
}
8 changes: 4 additions & 4 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
"newLine": true
},
"PollingTime": {
"type": "text",
"type": "number",
"sm": 12,
"md": 6,
"lg": 6,
"label": "Polling Interval",
"help": "Pollinginterval [msec]",
"help": "Pollinginterval [sec]",
"newLine": true
},
"TimeOut": {
"type": "text",
"type": "number",
"sm": 12,
"md": 6,
"lg": 6,
"label": "Timeout",
"help": "Timeout for API calls [msec]",
"help": "Timeout for API calls [sec]",
"newLine": true
}
}
Expand Down
8 changes: 4 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class Bluesound extends utils.Adapter {
return;
}

const pollingTime = parseFloat(this.config.PollingTime) || 30000;
this.log.info('[Start] PollingTime: ' + pollingTime);
const pollingTime = this.config.PollingTime * 1000 || 30000;
this.log.info('[Start] PollingTime [msec]: ' + pollingTime);

const timeOUT = parseFloat(this.config.TimeOut) || 2000;
this.log.info('[Start] Timeout: ' + timeOUT);
const timeOUT = this.config.TimeOut * 1000 || 2000;
this.log.info('[Start] Timeout [msec]: ' + timeOUT);

apiClient = axios.create({
baseURL: `http://${ip}:11000`,
Expand Down

0 comments on commit 20c91ec

Please sign in to comment.