homebridge-salus-cloud 0.1.2 → 0.1.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/README.md +8 -0
- package/dist/salusCloudClient.d.ts +25 -0
- package/dist/salusCloudClient.js +771 -21
- package/dist/salusCloudClient.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -94,11 +94,19 @@ Examples:
|
|
|
94
94
|
- Automatic token refresh before expiry and on `401` responses.
|
|
95
95
|
- Exponential backoff retries for transient network/API failures.
|
|
96
96
|
- API base fallback between `/api/v1` and `/api/v2`.
|
|
97
|
+
- Automatic compatibility fallback to legacy Salus cloud auth/API (`/users/sign_in.json` + `/apiv1`) when modern API returns persistent authorization errors (for example `response_code=900008`).
|
|
97
98
|
- Flexible shadow parser for multiple payload shapes.
|
|
98
99
|
- Flexible write payload fallback for service-api compatibility changes.
|
|
99
100
|
- Immediate short re-poll after write to keep HomeKit state aligned.
|
|
100
101
|
- Detailed logs for auth, discovery, shadow sync, writes, retries, and failures.
|
|
101
102
|
|
|
103
|
+
## 900008 troubleshooting
|
|
104
|
+
|
|
105
|
+
If logs show `response_code=900008` from modern `service-api`, this plugin now auto-switches into legacy compatibility mode and retries using the older Salus cloud stack. You will see:
|
|
106
|
+
|
|
107
|
+
- `Switching to legacy Salus cloud compatibility mode (...)`
|
|
108
|
+
- `Authenticated with Salus cloud (legacy API compatibility mode)`
|
|
109
|
+
|
|
102
110
|
## Salus features not cleanly mappable to HomeKit
|
|
103
111
|
|
|
104
112
|
These are intentionally not represented as extra virtual accessories:
|
|
@@ -5,16 +5,25 @@ export declare class SalusCloudClient {
|
|
|
5
5
|
private readonly config;
|
|
6
6
|
private session;
|
|
7
7
|
private authRequestInFlight;
|
|
8
|
+
private legacySession;
|
|
9
|
+
private legacyAuthRequestInFlight;
|
|
8
10
|
private readonly requestTimeoutMs;
|
|
9
11
|
private readonly maxRetries;
|
|
10
12
|
private readonly retryBaseDelayMs;
|
|
11
13
|
private readonly verboseLogging;
|
|
12
14
|
private readonly allowInsecureTls;
|
|
13
15
|
private readonly serviceApiBaseCandidates;
|
|
16
|
+
private readonly legacyApiBaseCandidates;
|
|
14
17
|
private readonly cognitoEndpoint;
|
|
15
18
|
private readonly cognitoClientId;
|
|
16
19
|
private readonly configuredCompanyCode;
|
|
20
|
+
private companyCodeCandidates;
|
|
21
|
+
private activeCompanyCode;
|
|
22
|
+
private hasWarnedAboutAuthCompanyCode;
|
|
17
23
|
private activeServiceApiBaseUrl;
|
|
24
|
+
private activeLegacyApiBaseUrl;
|
|
25
|
+
private apiTransportMode;
|
|
26
|
+
private hasWarnedAboutLegacyFallback;
|
|
18
27
|
private readonly propertyCacheByDsn;
|
|
19
28
|
private readonly deviceIdToDsn;
|
|
20
29
|
private readonly deviceKeyToDsn;
|
|
@@ -27,8 +36,15 @@ export declare class SalusCloudClient {
|
|
|
27
36
|
constructor(log: Logging, config: SalusPlatformConfig);
|
|
28
37
|
getCloudBaseUrl(): string;
|
|
29
38
|
listDevices(): Promise<SalusDevice[]>;
|
|
39
|
+
private listDevicesModern;
|
|
40
|
+
private listDevicesLegacy;
|
|
30
41
|
listProperties(dsn: string): Promise<SalusPropertyMap>;
|
|
42
|
+
private listPropertiesModern;
|
|
43
|
+
private listPropertiesLegacy;
|
|
31
44
|
setDatapoint(dsn: string, propertyName: string, value: unknown): Promise<void>;
|
|
45
|
+
private setDatapointModern;
|
|
46
|
+
private setDatapointLegacy;
|
|
47
|
+
private switchToLegacyTransport;
|
|
32
48
|
private rememberPreferredWriteAttempt;
|
|
33
49
|
private rebuildDeviceIndex;
|
|
34
50
|
private replacePropertyCache;
|
|
@@ -38,16 +54,25 @@ export declare class SalusCloudClient {
|
|
|
38
54
|
private findDeviceIdByDsn;
|
|
39
55
|
private findDeviceKeyByDsn;
|
|
40
56
|
private updateCachedProperty;
|
|
57
|
+
private refreshCompanyCodeCandidates;
|
|
58
|
+
private rotateCompanyCodeCandidate;
|
|
41
59
|
private ensureLoggedIn;
|
|
42
60
|
private login;
|
|
43
61
|
private refreshSession;
|
|
62
|
+
private ensureLegacyLoggedIn;
|
|
63
|
+
private loginLegacy;
|
|
64
|
+
private authenticateLegacyWithPassword;
|
|
44
65
|
private authenticateWithPassword;
|
|
45
66
|
private authenticateWithRefreshToken;
|
|
46
67
|
private cognitoInitiateAuth;
|
|
47
68
|
private requestServiceJsonWithPathFallback;
|
|
69
|
+
private requestLegacyJsonWithPathFallback;
|
|
48
70
|
private requestServiceJson;
|
|
71
|
+
private requestLegacyJson;
|
|
49
72
|
private buildServiceHeaders;
|
|
73
|
+
private buildLegacyHeaders;
|
|
50
74
|
private getOrderedServiceApiBaseUrls;
|
|
75
|
+
private getOrderedLegacyApiBaseUrls;
|
|
51
76
|
private retryDelay;
|
|
52
77
|
private fetchWithTimeout;
|
|
53
78
|
}
|