homebridge-winix-purifiers 2.2.3 → 2.2.4
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.js +1 -1
- package/dist/winix.js +6 -0
- package/package.json +2 -2
package/dist/platform.js
CHANGED
|
@@ -22,7 +22,6 @@ class WinixPurifierPlatform {
|
|
|
22
22
|
this.handlers = new Map();
|
|
23
23
|
this.deviceOverrides = (this.config.deviceOverrides ?? [])
|
|
24
24
|
.reduce((m, o) => m.set(o.deviceId, o), new Map());
|
|
25
|
-
this.client = new winix_api_1.WinixClient();
|
|
26
25
|
this.winix = new winix_1.WinixHandler(api.user.storagePath(), settings_1.ENCRYPTION_KEY);
|
|
27
26
|
this.api.on("didFinishLaunching" /* APIEvent.DID_FINISH_LAUNCHING */, this.onFinishLaunching.bind(this));
|
|
28
27
|
}
|
|
@@ -52,6 +51,7 @@ class WinixPurifierPlatform {
|
|
|
52
51
|
this.log.error('error getting devices:', e.message);
|
|
53
52
|
return;
|
|
54
53
|
}
|
|
54
|
+
this.client = new winix_api_1.WinixClient(this.winix.getIdentityId());
|
|
55
55
|
await this.discoverDevices();
|
|
56
56
|
// refresh devices on the configured interval
|
|
57
57
|
const refreshIntervalMs = (this.config.deviceRefreshIntervalMinutes ?? DEFAULT_DEVICE_REFRESH_INTERVAL_MINUTES) * 60 * 1000;
|
package/dist/winix.js
CHANGED
|
@@ -95,6 +95,12 @@ class WinixHandler {
|
|
|
95
95
|
return '';
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
+
getIdentityId() {
|
|
99
|
+
if (!this.winix) {
|
|
100
|
+
throw new UnauthenticatedError();
|
|
101
|
+
}
|
|
102
|
+
return this.winix.getIdentityId();
|
|
103
|
+
}
|
|
98
104
|
async getDevices() {
|
|
99
105
|
if (!this.winix || !this.auth) {
|
|
100
106
|
throw new UnauthenticatedError();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Winix Air Purifiers",
|
|
3
3
|
"name": "homebridge-winix-purifiers",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.4",
|
|
5
5
|
"description": "Homebridge plugin for Winix air purifiers",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
],
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@homebridge/plugin-ui-utils": "1.0.3",
|
|
68
|
-
"winix-api": "
|
|
68
|
+
"winix-api": "2.0.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "20.11.0",
|