homebridge-viessmann-vicare 2.0.13 → 2.0.15
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/dist/platform.d.ts +2 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +55 -1
- package/dist/settings.d.ts +1 -1
- package/dist/settings.js +1 -1
- package/package.json +4 -7
package/dist/platform.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare class ViessmannPlatform implements DynamicPlatformPlugin {
|
|
|
11
11
|
readonly Characteristic: typeof Characteristic;
|
|
12
12
|
readonly accessories: PlatformAccessory[];
|
|
13
13
|
readonly viessmannAPI: ViessmannAPI;
|
|
14
|
+
private configValid;
|
|
14
15
|
private installations;
|
|
15
16
|
private refreshTimer?;
|
|
16
17
|
private healthMonitoringTimer?;
|
|
@@ -21,6 +22,7 @@ export declare class ViessmannPlatform implements DynamicPlatformPlugin {
|
|
|
21
22
|
private pendingBurnerUpdates;
|
|
22
23
|
private burnerUpdateStats;
|
|
23
24
|
constructor(log: Logger, config: ViessmannPlatformConfig & PlatformConfig, api: API);
|
|
25
|
+
private validateConfig;
|
|
24
26
|
private setupBurnerUpdateSystem;
|
|
25
27
|
private handleBurnerStatusUpdate;
|
|
26
28
|
private updateAccessoriesWithBurnerStatus;
|
package/dist/platform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EAGH,qBAAqB,EACrB,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,cAAc,EACf,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACrI,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AM,EAAE,eAAe,EACvB,QAAQ,EAAE,gBAAgB,EAAE;IAgCxB,8BAA8B,CAClC,YAAY,EAAE,qBAAqB,EACnC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,gBAAgB,EAAE;IAuCxB,gBAAgB;IAuHtB,OAAO,CAAC,mBAAmB;IAqC3B,OAAO,CAAC,qBAAqB;IA2B7B,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,eAAe;IAiFhB,kBAAkB;;;;;;;;;IAKlB,iBAAiB;;;;;;;;;0BAlmBR,MAAM;+BACD,MAAM;2BACV,MAAM;yBACR,MAAM;4BACH,MAAM;4BACN,MAAM;2BACP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmnBxB"}
|
package/dist/platform.js
CHANGED
|
@@ -48,6 +48,7 @@ class ViessmannPlatform {
|
|
|
48
48
|
Characteristic;
|
|
49
49
|
accessories = [];
|
|
50
50
|
viessmannAPI;
|
|
51
|
+
configValid = false;
|
|
51
52
|
installations = [];
|
|
52
53
|
refreshTimer;
|
|
53
54
|
healthMonitoringTimer;
|
|
@@ -70,7 +71,23 @@ class ViessmannPlatform {
|
|
|
70
71
|
this.api = api;
|
|
71
72
|
this.Service = this.api.hap.Service;
|
|
72
73
|
this.Characteristic = this.api.hap.Characteristic;
|
|
73
|
-
|
|
74
|
+
// Validate required configuration before initializing
|
|
75
|
+
if (!this.validateConfig()) {
|
|
76
|
+
this.log.error('❌ Plugin disabled due to missing or invalid configuration.');
|
|
77
|
+
this.log.error('📖 Please configure the plugin via Homebridge UI or config.json.');
|
|
78
|
+
this.api.on("didFinishLaunching" /* APIEvent.DID_FINISH_LAUNCHING */, () => { });
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
this.viessmannAPI = new viessmann_api_1.ViessmannAPI(this.log, this.config, path.join(this.api.user.storagePath(), 'viessmann-tokens.json'));
|
|
83
|
+
this.configValid = true;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
this.log.error('❌ Failed to initialize Viessmann API:', error instanceof Error ? error.message : String(error));
|
|
87
|
+
this.log.error('📖 Please check your configuration and restart Homebridge.');
|
|
88
|
+
this.api.on("didFinishLaunching" /* APIEvent.DID_FINISH_LAUNCHING */, () => { });
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
74
91
|
// 🆕 NEW: Setup burner update callback
|
|
75
92
|
this.setupBurnerUpdateSystem();
|
|
76
93
|
this.log.debug('Finished initializing platform:', this.config.name || 'Viessmann');
|
|
@@ -93,6 +110,36 @@ class ViessmannPlatform {
|
|
|
93
110
|
this.viessmannAPI.cleanup();
|
|
94
111
|
});
|
|
95
112
|
}
|
|
113
|
+
validateConfig() {
|
|
114
|
+
const errors = [];
|
|
115
|
+
if (!this.config.clientId) {
|
|
116
|
+
errors.push('Missing required field: "clientId"');
|
|
117
|
+
}
|
|
118
|
+
else if (!/^[a-zA-Z0-9_-]+$/.test(this.config.clientId)) {
|
|
119
|
+
errors.push('Invalid "clientId" format - must contain only alphanumeric characters, underscores, and hyphens');
|
|
120
|
+
}
|
|
121
|
+
if (!this.config.username) {
|
|
122
|
+
errors.push('Missing required field: "username"');
|
|
123
|
+
}
|
|
124
|
+
else if (!this.config.username.includes('@')) {
|
|
125
|
+
errors.push('Invalid "username" - must be a valid email address');
|
|
126
|
+
}
|
|
127
|
+
if (!this.config.password) {
|
|
128
|
+
errors.push('Missing required field: "password"');
|
|
129
|
+
}
|
|
130
|
+
if (errors.length > 0) {
|
|
131
|
+
this.log.error('='.repeat(60));
|
|
132
|
+
this.log.error('❌ VIESSMANN PLUGIN CONFIGURATION ERROR');
|
|
133
|
+
this.log.error('='.repeat(60));
|
|
134
|
+
errors.forEach(e => this.log.error(` • ${e}`));
|
|
135
|
+
this.log.error('');
|
|
136
|
+
this.log.error('📖 Configure the plugin at:');
|
|
137
|
+
this.log.error(' Homebridge UI → Plugins → Viessmann → Settings');
|
|
138
|
+
this.log.error('='.repeat(60));
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
96
143
|
// 🆕 NEW: Setup burner update system
|
|
97
144
|
setupBurnerUpdateSystem() {
|
|
98
145
|
// Set callback in API endpoints to receive burner status updates
|
|
@@ -320,6 +367,10 @@ class ViessmannPlatform {
|
|
|
320
367
|
this.accessories.push(accessory);
|
|
321
368
|
}
|
|
322
369
|
async discoverDevices() {
|
|
370
|
+
if (!this.configValid || !this.viessmannAPI) {
|
|
371
|
+
this.log.warn('⚠️ Skipping device discovery - plugin not configured.');
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
323
374
|
try {
|
|
324
375
|
// Check rate limit status before attempting discovery
|
|
325
376
|
const rateLimitStatus = this.viessmannAPI.getRateLimitStatus();
|
|
@@ -701,6 +752,9 @@ class ViessmannPlatform {
|
|
|
701
752
|
}
|
|
702
753
|
// Health Monitoring Methods
|
|
703
754
|
startHealthMonitoring() {
|
|
755
|
+
if (!this.configValid || !this.viessmannAPI) {
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
704
758
|
if (!this.config.enableApiMetrics) {
|
|
705
759
|
return;
|
|
706
760
|
}
|
package/dist/settings.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const PLUGIN_NAME = "homebridge-viessmann-vicare";
|
|
|
9
9
|
/**
|
|
10
10
|
* Plugin version for User-Agent and logging
|
|
11
11
|
*/
|
|
12
|
-
export declare const PLUGIN_VERSION = "2.0.
|
|
12
|
+
export declare const PLUGIN_VERSION = "2.0.15";
|
|
13
13
|
/**
|
|
14
14
|
* Default configuration values
|
|
15
15
|
*/
|
package/dist/settings.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-viessmann-vicare",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.15",
|
|
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": {
|
|
@@ -39,14 +39,11 @@
|
|
|
39
39
|
"homebridge": ">=1.8.0 || >=2.0.0-beta.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"axios": "^1.
|
|
42
|
+
"axios": "^1.13.5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@types/node": "^20.
|
|
46
|
-
"typescript": "^5.
|
|
47
|
-
},
|
|
48
|
-
"peerDependencies": {
|
|
49
|
-
"homebridge": ">=1.8.0"
|
|
45
|
+
"@types/node": "^20.19.35",
|
|
46
|
+
"typescript": "^5.9.3"
|
|
50
47
|
},
|
|
51
48
|
"files": [
|
|
52
49
|
"dist",
|