homebridge-viessmann-vicare 2.0.1 → 2.0.2
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/config.schema.json +1 -1
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +1 -1
- package/dist/auth-manager.d.ts +34 -0
- package/dist/auth-manager.d.ts.map +1 -1
- package/dist/auth-manager.js +126 -31
- package/dist/settings.js +2 -2
- package/package.json +1 -1
package/config.schema.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"type": "string",
|
|
20
20
|
"required": true,
|
|
21
21
|
"pattern": "^[a-zA-Z0-9_-]+$",
|
|
22
|
-
"description": "Your Viessmann API Client ID from the developer portal. Must contain only alphanumeric characters, underscores, and hyphens. Get it from https://developer.viessmann.com/"
|
|
22
|
+
"description": "Your Viessmann API Client ID from the developer portal. Must contain only alphanumeric characters, underscores, and hyphens. Get it from https://developer.viessmann-climatesolutions.com/"
|
|
23
23
|
},
|
|
24
24
|
"clientSecret": {
|
|
25
25
|
"title": "Client Secret",
|
package/dist/api-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAc,EAAiB,aAAa,EAA0C,MAAM,OAAO,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAoB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAY,WAAW,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAoB,UAAU,EAAE,MAAM,sBAAsB,CAAC;AASpE,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,yBAAyB,EAAE,OAAO,CAAC;I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AM;IAK3B,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC;IAK9C,OAAO,IAAI,IAAI;CAIvB"}
|
package/dist/api-client.js
CHANGED
package/dist/auth-manager.d.ts
CHANGED
|
@@ -53,6 +53,40 @@ export declare class AuthManager {
|
|
|
53
53
|
private buildAuthUrl;
|
|
54
54
|
private startAuthServer;
|
|
55
55
|
private stopAuthServer;
|
|
56
|
+
/** private openBrowser(url: string): void {
|
|
57
|
+
const { exec } = require('child_process');
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
let command: string;
|
|
61
|
+
|
|
62
|
+
switch (process.platform) {
|
|
63
|
+
case 'darwin': // macOS
|
|
64
|
+
command = `open "${url}"`;
|
|
65
|
+
break;
|
|
66
|
+
case 'win32': // Windows
|
|
67
|
+
command = `start "" "${url}"`;
|
|
68
|
+
break;
|
|
69
|
+
case 'linux': // Linux
|
|
70
|
+
command = `xdg-open "${url}" || firefox "${url}" || google-chrome "${url}" || chromium "${url}"`;
|
|
71
|
+
break;
|
|
72
|
+
default:
|
|
73
|
+
this.log.warn('⚠️ Cannot auto-open browser on this platform. Please open the URL manually.');
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
exec(command, (error: any) => {
|
|
78
|
+
if (error) {
|
|
79
|
+
this.log.warn('⚠️ Could not auto-open browser:', error.message);
|
|
80
|
+
this.log.info('📝 Please open the authentication URL manually in your browser.');
|
|
81
|
+
} else {
|
|
82
|
+
this.log.info('🌐 Opening browser for authentication...');
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
} catch (error) {
|
|
86
|
+
this.log.warn('⚠️ Error opening browser:', error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
**/
|
|
56
90
|
private openBrowser;
|
|
57
91
|
private exchangeCodeForTokens;
|
|
58
92
|
refreshAccessToken(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-manager.d.ts","source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C,OAAO,CAAC,iBAAiB;IAoBzB,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,gBAAgB;IA0CxB,OAAO,CAAC,UAAU;IAkDlB,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,oBAAoB;IAgCf,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAiC1C,OAAO,CAAC,mBAAmB;YA0Bb,eAAe;YAWf,gBAAgB;IAyC9B,OAAO,CAAC,YAAY;YAUN,eAAe;IAgD7B,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,eAAe;IA2DvB,OAAO,CAAC,cAAc;IAcvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiCE;IACH,OAAO,CAAC,WAAW;YA8EH,qBAAqB;IAoCtB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqChD,OAAO,CAAC,SAAS;IA0BV,cAAc,IAAI,MAAM,GAAG,SAAS;IAIpC,cAAc,IAAI;QACvB,SAAS,EAAE,OAAO,CAAC;QACnB,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,OAAO,CAAC;QACzB,qBAAqB,CAAC,EAAE,IAAI,CAAC;QAC7B,yBAAyB,CAAC,EAAE,MAAM,CAAC;QACnC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,CAAC;KACjB;IAeM,OAAO,IAAI,IAAI;CAiBvB"}
|
package/dist/auth-manager.js
CHANGED
|
@@ -44,7 +44,7 @@ class AuthManager {
|
|
|
44
44
|
config;
|
|
45
45
|
httpClient;
|
|
46
46
|
hostIp;
|
|
47
|
-
authURL = 'https://iam.viessmann.com/idp/v3';
|
|
47
|
+
authURL = 'https://iam.viessmann-climatesolutions.com/idp/v3';
|
|
48
48
|
redirectUri;
|
|
49
49
|
tokenStoragePath;
|
|
50
50
|
// TTL Constants from Viessmann API documentation
|
|
@@ -344,7 +344,7 @@ class AuthManager {
|
|
|
344
344
|
this.log.error('');
|
|
345
345
|
this.log.error('📋 Follow these steps:');
|
|
346
346
|
this.log.error('');
|
|
347
|
-
this.log.error('1. 🌐 Visit: https://developer.viessmann.com/');
|
|
347
|
+
this.log.error('1. 🌐 Visit: https://developer.viessmann-climatesolutions.com/');
|
|
348
348
|
this.log.error('2. 📝 Create an application with these settings:');
|
|
349
349
|
this.log.error(' • Name: homebridge-viessmann-vicare');
|
|
350
350
|
this.log.error(' • Type: Public Client');
|
|
@@ -356,7 +356,7 @@ class AuthManager {
|
|
|
356
356
|
this.log.error(` ${authUrl}`);
|
|
357
357
|
this.log.error('');
|
|
358
358
|
this.log.error('4. ⚡ QUICKLY exchange authorization code for tokens (20 second limit!):');
|
|
359
|
-
this.log.error(' curl -X POST "https://iam.viessmann.com/idp/v3/token" \\');
|
|
359
|
+
this.log.error(' curl -X POST "https://iam.viessmann-climatesolutions.com/idp/v3/token" \\');
|
|
360
360
|
this.log.error(' -H "Content-Type: application/x-www-form-urlencoded" \\');
|
|
361
361
|
this.log.error(` -d "client_id=${this.config.clientId}&redirect_uri=${encodeURIComponent(this.redirectUri)}&grant_type=authorization_code&code_verifier=${this.codeVerifier}&code=YOUR_AUTH_CODE"`);
|
|
362
362
|
this.log.error('');
|
|
@@ -498,37 +498,132 @@ class AuthManager {
|
|
|
498
498
|
this.authTimeout = undefined;
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
+
/** private openBrowser(url: string): void {
|
|
502
|
+
const { exec } = require('child_process');
|
|
503
|
+
|
|
504
|
+
try {
|
|
505
|
+
let command: string;
|
|
506
|
+
|
|
507
|
+
switch (process.platform) {
|
|
508
|
+
case 'darwin': // macOS
|
|
509
|
+
command = `open "${url}"`;
|
|
510
|
+
break;
|
|
511
|
+
case 'win32': // Windows
|
|
512
|
+
command = `start "" "${url}"`;
|
|
513
|
+
break;
|
|
514
|
+
case 'linux': // Linux
|
|
515
|
+
command = `xdg-open "${url}" || firefox "${url}" || google-chrome "${url}" || chromium "${url}"`;
|
|
516
|
+
break;
|
|
517
|
+
default:
|
|
518
|
+
this.log.warn('⚠️ Cannot auto-open browser on this platform. Please open the URL manually.');
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
exec(command, (error: any) => {
|
|
523
|
+
if (error) {
|
|
524
|
+
this.log.warn('⚠️ Could not auto-open browser:', error.message);
|
|
525
|
+
this.log.info('📝 Please open the authentication URL manually in your browser.');
|
|
526
|
+
} else {
|
|
527
|
+
this.log.info('🌐 Opening browser for authentication...');
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
} catch (error) {
|
|
531
|
+
this.log.warn('⚠️ Error opening browser:', error);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
**/
|
|
501
535
|
openBrowser(url) {
|
|
502
|
-
const { exec } = require('child_process');
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
536
|
+
const { execFile, exec } = require('child_process');
|
|
537
|
+
const tryExecFile = (cmd, args, env) => new Promise((resolve, reject) => {
|
|
538
|
+
execFile(cmd, args, { env }, (err) => err ? reject(err) : resolve());
|
|
539
|
+
});
|
|
540
|
+
const tryExec = (command, env) => new Promise((resolve, reject) => {
|
|
541
|
+
exec(command, { env }, (err) => err ? reject(err) : resolve());
|
|
542
|
+
});
|
|
543
|
+
// Copia pulita dell'ambiente
|
|
544
|
+
const env = { ...process.env };
|
|
545
|
+
// Migliora compatibilità Linux (X/Wayland) senza toccare il servizio
|
|
546
|
+
if (process.platform === 'linux') {
|
|
547
|
+
if (!env.DISPLAY) {
|
|
548
|
+
// fallback tipico X11
|
|
549
|
+
env.DISPLAY = ':0';
|
|
550
|
+
}
|
|
551
|
+
if (!env.XDG_RUNTIME_DIR && typeof process.getuid === 'function') {
|
|
552
|
+
env.XDG_RUNTIME_DIR = `/run/user/${process.getuid()}`;
|
|
518
553
|
}
|
|
519
|
-
exec(command, (error) => {
|
|
520
|
-
if (error) {
|
|
521
|
-
this.log.warn('⚠️ Could not auto-open browser:', error.message);
|
|
522
|
-
this.log.info('📝 Please open the authentication URL manually in your browser.');
|
|
523
|
-
}
|
|
524
|
-
else {
|
|
525
|
-
this.log.info('🌐 Opening browser for authentication...');
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
catch (error) {
|
|
530
|
-
this.log.warn('⚠️ Error opening browser:', error);
|
|
531
554
|
}
|
|
555
|
+
const tryLinux = async () => {
|
|
556
|
+
// 1) Standard freedesktop
|
|
557
|
+
try {
|
|
558
|
+
await tryExecFile('xdg-open', [url], env);
|
|
559
|
+
this.log.debug('🌐 xdg-open OK');
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
catch { }
|
|
563
|
+
// 2) Gio / GVFS
|
|
564
|
+
try {
|
|
565
|
+
await tryExec(`gio open "${url}"`, env);
|
|
566
|
+
this.log.debug('🌐 gio open OK');
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
catch { }
|
|
570
|
+
// 3) Debian-like helpers
|
|
571
|
+
try {
|
|
572
|
+
await tryExecFile('sensible-browser', [url], env);
|
|
573
|
+
this.log.debug('🌐 sensible-browser OK');
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
catch { }
|
|
577
|
+
try {
|
|
578
|
+
await tryExecFile('x-www-browser', [url], env);
|
|
579
|
+
this.log.debug('🌐 x-www-browser OK');
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
catch { }
|
|
583
|
+
// 4) xdg-desktop-portal (DBus OpenURI) — compatibile Wayland/X
|
|
584
|
+
try {
|
|
585
|
+
await tryExec(`gdbus call --session ` +
|
|
586
|
+
`--dest org.freedesktop.portal.Desktop ` +
|
|
587
|
+
`--object-path /org/freedesktop/portal/desktop ` +
|
|
588
|
+
`--method org.freedesktop.portal.OpenURI.OpenURI "" "${url}" "{}"`, env);
|
|
589
|
+
this.log.debug('🌐 xdg-desktop-portal OpenURI OK');
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
catch { }
|
|
593
|
+
// 5) backend specifici (best-effort, non bloccanti)
|
|
594
|
+
try {
|
|
595
|
+
await tryExecFile('kde-open5', [url], env);
|
|
596
|
+
this.log.debug('🌐 kde-open5 OK');
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
catch { }
|
|
600
|
+
try {
|
|
601
|
+
await tryExecFile('gnome-open', [url], env);
|
|
602
|
+
this.log.debug('🌐 gnome-open OK');
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
catch { }
|
|
606
|
+
// Nessun metodo disponibile/riuscito
|
|
607
|
+
throw new Error('No Linux opener succeeded');
|
|
608
|
+
};
|
|
609
|
+
(async () => {
|
|
610
|
+
try {
|
|
611
|
+
switch (process.platform) {
|
|
612
|
+
case 'darwin':
|
|
613
|
+
await tryExec(`open "${url}"`, env);
|
|
614
|
+
break;
|
|
615
|
+
case 'win32':
|
|
616
|
+
await tryExec(`start "" "${url}"`, env);
|
|
617
|
+
break;
|
|
618
|
+
default:
|
|
619
|
+
await tryLinux();
|
|
620
|
+
}
|
|
621
|
+
this.log.info('✅ Tentativo di apertura browser completato');
|
|
622
|
+
}
|
|
623
|
+
catch (e) {
|
|
624
|
+
this.log.warn(`⚠️ Impossibile aprire automaticamente il browser (${e?.message || e}). Apri l’URL manualmente.`);
|
|
625
|
+
}
|
|
626
|
+
})();
|
|
532
627
|
}
|
|
533
628
|
async exchangeCodeForTokens(authCode) {
|
|
534
629
|
const tokenData = new url_1.URLSearchParams({
|
package/dist/settings.js
CHANGED
|
@@ -65,8 +65,8 @@ exports.DEFAULT_CONFIG = {
|
|
|
65
65
|
* Viessmann API endpoints
|
|
66
66
|
*/
|
|
67
67
|
exports.VIESSMANN_API = {
|
|
68
|
-
baseURL: 'https://api.viessmann.com',
|
|
69
|
-
authURL: 'https://iam.viessmann.com/idp/v3',
|
|
68
|
+
baseURL: 'https://api.viessmann-climatesolutions.com',
|
|
69
|
+
authURL: 'https://iam.viessmann-climatesolutions.com/idp/v3',
|
|
70
70
|
scope: 'IoT User offline_access',
|
|
71
71
|
endpoints: {
|
|
72
72
|
installations: '/iot/v2/equipment/installations',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-viessmann-vicare",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Complete Homebridge plugin for Viessmann ViCare heating systems with full control capabilities, advanced rate limiting protection, and intelligent cache management",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|