@homebridge-plugins/homebridge-tado 7.5.3 → 7.6.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/CHANGELOG.md +5 -0
- package/index.js +2 -3
- package/package.json +7 -7
- package/src/helper/telegram.js +1 -0
- package/src/platform.js +32 -43
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
**/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import TadoPlatform from './src/platform.js';
|
|
10
10
|
|
|
11
11
|
export default function (homebridge) {
|
|
12
|
-
|
|
13
|
-
homebridge.registerPlatform('TadoPlatform', TadoPlatform);
|
|
12
|
+
homebridge.registerPlatform('TadoPlatform', TadoPlatform(homebridge));
|
|
14
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homebridge-plugins/homebridge-tado",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0",
|
|
4
4
|
"description": "Homebridge plugin for controlling tado° devices.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,22 +32,22 @@
|
|
|
32
32
|
"homebridge": "^1.6.0||^2.0.0-beta.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@homebridge/plugin-ui-utils": "^2.0.
|
|
35
|
+
"@homebridge/plugin-ui-utils": "^2.0.2",
|
|
36
36
|
"fakegato-history": "^0.6.7",
|
|
37
37
|
"form-data": "^4.0.2",
|
|
38
38
|
"fs-extra": "^11.3.0",
|
|
39
|
-
"got": "^14.4.
|
|
39
|
+
"got": "^14.4.7",
|
|
40
40
|
"moment": "^2.30.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@babel/core": "7.26.10",
|
|
44
44
|
"@babel/eslint-parser": "7.27.0",
|
|
45
45
|
"@babel/eslint-plugin": "7.27.0",
|
|
46
|
-
"@eslint/js": "^9.
|
|
47
|
-
"eslint": "^9.
|
|
48
|
-
"eslint-config-prettier": "^10.1.
|
|
46
|
+
"@eslint/js": "^9.25.1",
|
|
47
|
+
"eslint": "^9.25.1",
|
|
48
|
+
"eslint-config-prettier": "^10.1.2",
|
|
49
49
|
"eslint-plugin-import": "^2.31.0",
|
|
50
|
-
"eslint-plugin-prettier": "^5.2.
|
|
50
|
+
"eslint-plugin-prettier": "^5.2.6",
|
|
51
51
|
"globals": "^16.0.0",
|
|
52
52
|
"prettier": "^3.5.3"
|
|
53
53
|
}
|
package/src/helper/telegram.js
CHANGED
package/src/platform.js
CHANGED
|
@@ -26,44 +26,37 @@ import EveTypes from './types/eve.js';
|
|
|
26
26
|
|
|
27
27
|
const PLUGIN_NAME = '@homebridge-plugins/homebridge-tado';
|
|
28
28
|
const PLATFORM_NAME = 'TadoPlatform';
|
|
29
|
-
|
|
30
|
-
var Accessory, UUIDGen, FakeGatoHistoryService;
|
|
29
|
+
let Accessory, UUIDGen, FakeGatoHistoryService;
|
|
31
30
|
|
|
32
31
|
export default function (homebridge) {
|
|
33
32
|
Accessory = homebridge.platformAccessory;
|
|
34
33
|
UUIDGen = homebridge.hap.uuid;
|
|
35
|
-
|
|
36
34
|
return TadoPlatform;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function TadoPlatform(log, config, api) {
|
|
40
|
-
if (!api || !config) return;
|
|
41
|
-
|
|
42
|
-
//init logger
|
|
43
|
-
Logger.init(log, config.debug);
|
|
35
|
+
}
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
FakeGatoHistoryService = fakeGatoHistory(api);
|
|
37
|
+
class TadoPlatform {
|
|
38
|
+
constructor(log, config, api) {
|
|
39
|
+
if (!api || !config) return;
|
|
49
40
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.packageJson = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), "..", "package.json"), "utf-8"));
|
|
55
|
-
const storagePath = this.api.user.storagePath();
|
|
41
|
+
Logger.init(log, config.debug);
|
|
42
|
+
CustomTypes.registerWith(api.hap);
|
|
43
|
+
EveTypes.registerWith(api.hap);
|
|
44
|
+
FakeGatoHistoryService = fakeGatoHistory(api);
|
|
56
45
|
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
this.api = api;
|
|
47
|
+
this.accessories = [];
|
|
48
|
+
this.config = config;
|
|
49
|
+
this.user = [];
|
|
50
|
+
this.packageJson = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), "..", "package.json"), "utf-8"));
|
|
51
|
+
const storagePath = this.api.user.storagePath();
|
|
59
52
|
|
|
60
|
-
|
|
53
|
+
this.setupPlugin(storagePath);
|
|
54
|
+
if (!this.user.length) this.setupConfig(storagePath);
|
|
61
55
|
|
|
62
|
-
|
|
63
|
-
}
|
|
56
|
+
this.api.on('didFinishLaunching', this.didFinishLaunching.bind(this));
|
|
57
|
+
}
|
|
64
58
|
|
|
65
|
-
|
|
66
|
-
setupPlugin: async function (storagePath) {
|
|
59
|
+
async setupPlugin(storagePath) {
|
|
67
60
|
try {
|
|
68
61
|
if (this.config.user && this.config.user.length) {
|
|
69
62
|
for (const credentials of this.config.user) {
|
|
@@ -141,11 +134,9 @@ TadoPlatform.prototype = {
|
|
|
141
134
|
Logger.error('An error occured during setting up plugin!');
|
|
142
135
|
Logger.error(err);
|
|
143
136
|
}
|
|
137
|
+
}
|
|
144
138
|
|
|
145
|
-
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
setupConfig: function (storagePath) {
|
|
139
|
+
setupConfig(storagePath) {
|
|
149
140
|
try {
|
|
150
141
|
const { config, devices, deviceHandler, telegram } = TadoConfig.setup(this.config, UUIDGen, storagePath);
|
|
151
142
|
|
|
@@ -157,11 +148,9 @@ TadoPlatform.prototype = {
|
|
|
157
148
|
Logger.error('An error occured during setting up plugin!');
|
|
158
149
|
Logger.error(err);
|
|
159
150
|
}
|
|
151
|
+
}
|
|
160
152
|
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
didFinishLaunching: function () {
|
|
153
|
+
didFinishLaunching() {
|
|
165
154
|
if (this.user.length) return;
|
|
166
155
|
|
|
167
156
|
for (const entry of this.devices.entries()) {
|
|
@@ -206,9 +195,9 @@ TadoPlatform.prototype = {
|
|
|
206
195
|
const deviceHandler = DeviceHandler(this.api, accessories, config, tado, this.telegram);
|
|
207
196
|
deviceHandler.getStates();
|
|
208
197
|
}
|
|
209
|
-
}
|
|
198
|
+
}
|
|
210
199
|
|
|
211
|
-
setupAccessory
|
|
200
|
+
setupAccessory(accessory, device) {
|
|
212
201
|
accessory.on('identify', () => {
|
|
213
202
|
Logger.info('Identify requested.', accessory.displayName);
|
|
214
203
|
});
|
|
@@ -296,9 +285,9 @@ TadoPlatform.prototype = {
|
|
|
296
285
|
}
|
|
297
286
|
|
|
298
287
|
return;
|
|
299
|
-
}
|
|
288
|
+
}
|
|
300
289
|
|
|
301
|
-
configureAccessory
|
|
290
|
+
configureAccessory(accessory, refresh) {
|
|
302
291
|
if (!this.user.length) {
|
|
303
292
|
const device = this.devices.get(accessory.UUID);
|
|
304
293
|
|
|
@@ -309,9 +298,9 @@ TadoPlatform.prototype = {
|
|
|
309
298
|
}
|
|
310
299
|
|
|
311
300
|
if (!refresh) this.accessories.push(accessory);
|
|
312
|
-
}
|
|
301
|
+
}
|
|
313
302
|
|
|
314
|
-
removeAccessory
|
|
303
|
+
removeAccessory(accessory) {
|
|
315
304
|
Logger.info('Removing accessory...', accessory.displayName);
|
|
316
305
|
|
|
317
306
|
let accessories = this.accessories.map((cachedAccessory) => {
|
|
@@ -325,5 +314,5 @@ TadoPlatform.prototype = {
|
|
|
325
314
|
});
|
|
326
315
|
|
|
327
316
|
this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
317
|
+
}
|
|
318
|
+
}
|