homebridge-denon-tv 6.1.21 → 6.1.22-beta.0
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 +1 -1
- package/src/denon.js +5 -2
package/package.json
CHANGED
package/src/denon.js
CHANGED
|
@@ -16,14 +16,17 @@ class Denon extends EventEmitter {
|
|
|
16
16
|
this.firstRun = true;
|
|
17
17
|
this.functions = new Functions();
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
// Some gen 2 (2023+) models front their API with HTTPS on port 443 (e.g. self-signed nginx),
|
|
20
|
+
// others still serve plain HTTP on 80/8080 (e.g. Cinema series) - use the port as the signal.
|
|
21
|
+
const useHttps = this.generation === 2 && Number(config.port) === 443;
|
|
22
|
+
const protocol = useHttps ? 'https' : 'http';
|
|
20
23
|
const baseUrl = `${protocol}://${config.host}:${config.port}`;
|
|
21
24
|
const commonConfig = {
|
|
22
25
|
baseURL: baseUrl,
|
|
23
26
|
timeout: 20000
|
|
24
27
|
};
|
|
25
28
|
|
|
26
|
-
const httpsConfig =
|
|
29
|
+
const httpsConfig = useHttps ? { httpsAgent: new HttpsAgent({ rejectUnauthorized: false, keepAlive: false }) } : {};
|
|
27
30
|
this.client = axios.create({
|
|
28
31
|
...commonConfig,
|
|
29
32
|
...httpsConfig,
|