homebridge-toshiba-plugin 0.2.8 → 0.2.9
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 +3 -6
- package/config.schema.json +1 -4
- package/dist/platform.d.ts +1 -18
- package/dist/platform.js +142 -496
- package/dist/platform.js.map +1 -1
- package/dist/platformAccessory.d.ts +3 -30
- package/dist/platformAccessory.js +137 -370
- package/dist/platformAccessory.js.map +1 -1
- package/dist/toshiba/amqpClient.d.ts +2 -12
- package/dist/toshiba/amqpClient.js +28 -198
- package/dist/toshiba/amqpClient.js.map +1 -1
- package/dist/toshiba/device.d.ts +13 -68
- package/dist/toshiba/device.js +52 -414
- package/dist/toshiba/device.js.map +1 -1
- package/dist/toshiba/features.d.ts +1 -10
- package/dist/toshiba/features.js +14 -45
- package/dist/toshiba/features.js.map +1 -1
- package/dist/toshiba/httpApi.d.ts +6 -16
- package/dist/toshiba/httpApi.js +63 -197
- package/dist/toshiba/httpApi.js.map +1 -1
- package/dist/toshiba/state.d.ts +0 -33
- package/dist/toshiba/state.js +21 -185
- package/dist/toshiba/state.js.map +1 -1
- package/dist/toshiba/types.d.ts +0 -15
- package/package.json +9 -9
- package/dist/nameUtils.d.ts +0 -13
- package/dist/nameUtils.js +0 -108
- package/dist/nameUtils.js.map +0 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Homebridge dynamic platform plugin for Toshiba **Home AC Control** cloud devices
|
|
|
15
15
|
- Mobile cloud registration supports both response formats used by the app backend (`SasToken` or `HostName` + `DeviceId` + `PrimaryKey`).
|
|
16
16
|
- Startup self-recovery for transient cloud/network errors with exponential retry backoff.
|
|
17
17
|
- Device auto-discovery and cache reconciliation.
|
|
18
|
-
-
|
|
18
|
+
- Resilient discovery parsing (malformed cloud entries are skipped instead of aborting discovery).
|
|
19
19
|
- Automatic AMQP reconnect with exponential backoff after cloud disconnects.
|
|
20
20
|
- AMQP operation timeout guards (connect/send/disconnect) with failure-triggered recovery.
|
|
21
21
|
- Poll/discovery overlap protection to avoid queue buildup during slow cloud responses.
|
|
@@ -25,10 +25,8 @@ Homebridge dynamic platform plugin for Toshiba **Home AC Control** cloud devices
|
|
|
25
25
|
- No-op command suppression (skips AMQP send when requested state already matches current effective state).
|
|
26
26
|
- Command preflight online check (`GetAllDeviceState`) before AMQP sends, with offline protection.
|
|
27
27
|
- Short-lived connection-state cache on command precheck to reduce command latency and cloud rate-limit pressure.
|
|
28
|
-
-
|
|
29
|
-
- Command
|
|
30
|
-
- Local receive generations prevent a delayed HTTP snapshot from overwriting state received after that request began. Toshiba's time-of-day-only push timestamp is not used to order packets across reconnects or midnight, so genuinely out-of-order push packets follow local arrival order.
|
|
31
|
-
- Shutdown/disposal aborts in-flight HTTP requests, retry backoff, and command-confirmation readbacks.
|
|
28
|
+
- If online precheck itself fails (timeout/network/transient cloud error), command falls back to best-effort send instead of hard-failing control.
|
|
29
|
+
- Command-send retries with detailed logs for transient AMQP send failures.
|
|
32
30
|
- Defensive payload parsing and malformed-cloud-update guards.
|
|
33
31
|
- Single accessory model: each Toshiba AC is exposed as one HomeKit `HeaterCooler` service (no extra Fan/Switch/Sensor services).
|
|
34
32
|
- HeaterCooler control:
|
|
@@ -126,7 +124,6 @@ homebridge -D
|
|
|
126
124
|
```bash
|
|
127
125
|
npm run lint
|
|
128
126
|
npm run build
|
|
129
|
-
npm test
|
|
130
127
|
```
|
|
131
128
|
|
|
132
129
|
## Publish
|
package/config.schema.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"pluginAlias": "ToshibaSmartAC",
|
|
3
3
|
"pluginType": "platform",
|
|
4
4
|
"singular": true,
|
|
5
|
-
"strictValidation":
|
|
5
|
+
"strictValidation": true,
|
|
6
6
|
"schema": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"required": [
|
|
@@ -63,21 +63,18 @@
|
|
|
63
63
|
"enableFanService": {
|
|
64
64
|
"title": "Expose Fan Service (Deprecated)",
|
|
65
65
|
"type": "boolean",
|
|
66
|
-
"hidden": true,
|
|
67
66
|
"default": false,
|
|
68
67
|
"description": "Deprecated and ignored. Plugin now exposes a single HeaterCooler service only."
|
|
69
68
|
},
|
|
70
69
|
"enableFeatureSwitches": {
|
|
71
70
|
"title": "Expose Feature Switches (Deprecated)",
|
|
72
71
|
"type": "boolean",
|
|
73
|
-
"hidden": true,
|
|
74
72
|
"default": false,
|
|
75
73
|
"description": "Deprecated and ignored. Plugin now exposes a single HeaterCooler service only."
|
|
76
74
|
},
|
|
77
75
|
"enableTemperatureSensors": {
|
|
78
76
|
"title": "Expose Temperature Sensors (Deprecated)",
|
|
79
77
|
"type": "boolean",
|
|
80
|
-
"hidden": true,
|
|
81
78
|
"default": false,
|
|
82
79
|
"description": "Deprecated and ignored. Plugin now exposes a single HeaterCooler service only."
|
|
83
80
|
}
|
package/dist/platform.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { API, Characteristic, DynamicPlatformPlugin, Logging, PlatformAccessory, PlatformConfig, Service } from 'homebridge';
|
|
2
|
-
import { ToshibaAcDevice } from './toshiba/device.js';
|
|
3
2
|
interface ToshibaPlatformConfig extends PlatformConfig {
|
|
4
3
|
username?: string;
|
|
5
4
|
password?: string;
|
|
@@ -7,9 +6,6 @@ interface ToshibaPlatformConfig extends PlatformConfig {
|
|
|
7
6
|
discoveryRefreshMinutes?: number;
|
|
8
7
|
requestTimeoutSeconds?: number;
|
|
9
8
|
httpRetries?: number;
|
|
10
|
-
enableFanService?: boolean;
|
|
11
|
-
enableFeatureSwitches?: boolean;
|
|
12
|
-
enableTemperatureSensors?: boolean;
|
|
13
9
|
}
|
|
14
10
|
type ToshibaCloudConnectionState = 'online' | 'offline' | 'unknown';
|
|
15
11
|
export declare class ToshibaSmartACPlatform implements DynamicPlatformPlugin {
|
|
@@ -24,8 +20,6 @@ export declare class ToshibaSmartACPlatform implements DynamicPlatformPlugin {
|
|
|
24
20
|
private readonly connectionStateCache;
|
|
25
21
|
private readonly missingConnectionStateCounts;
|
|
26
22
|
private readonly stateEndpointByDevice;
|
|
27
|
-
private readonly missingAccessoryCounts;
|
|
28
|
-
private consecutiveSuspiciousEmptyInventories;
|
|
29
23
|
private readonly sessionId;
|
|
30
24
|
private httpApi?;
|
|
31
25
|
private amqpClient?;
|
|
@@ -40,14 +34,9 @@ export declare class ToshibaSmartACPlatform implements DynamicPlatformPlugin {
|
|
|
40
34
|
private stateRefreshInProgress;
|
|
41
35
|
private discoveryRefreshInProgress;
|
|
42
36
|
private additionalInfoEndpointForbidden;
|
|
43
|
-
private stateStaleAfterMs;
|
|
44
|
-
private readonly shutdownController;
|
|
45
37
|
constructor(log: Logging, config: ToshibaPlatformConfig, api: API);
|
|
46
38
|
configureAccessory(accessory: PlatformAccessory): void;
|
|
47
|
-
private markCachedAccessoryUnavailable;
|
|
48
39
|
getDeviceCloudConnectionState(uniqueId: string): ToshibaCloudConnectionState;
|
|
49
|
-
isDeviceStateFresh(device: ToshibaAcDevice): boolean;
|
|
50
|
-
isDeviceStateTimestampFresh(receivedAt: number | undefined): boolean;
|
|
51
40
|
private start;
|
|
52
41
|
private connectCloud;
|
|
53
42
|
private refreshSasToken;
|
|
@@ -56,15 +45,10 @@ export declare class ToshibaSmartACPlatform implements DynamicPlatformPlugin {
|
|
|
56
45
|
private scheduleTokenRefreshRetry;
|
|
57
46
|
private calculateTokenRefreshDelayMs;
|
|
58
47
|
private discoverDevices;
|
|
59
|
-
private resolveDiscoveredName;
|
|
60
|
-
private updateCachedAccessory;
|
|
61
48
|
private removeStaleAccessories;
|
|
62
|
-
private resetDiscoveryPruningEvidence;
|
|
63
49
|
private startStatePolling;
|
|
64
50
|
private startDiscoveryRefresh;
|
|
65
51
|
private refreshStates;
|
|
66
|
-
private refreshSingleDeviceState;
|
|
67
|
-
private forEachWithConcurrency;
|
|
68
52
|
private fetchLatestStateForDevice;
|
|
69
53
|
private getStateEndpointStatus;
|
|
70
54
|
private markStateEndpointForbidden;
|
|
@@ -78,16 +62,15 @@ export declare class ToshibaSmartACPlatform implements DynamicPlatformPlugin {
|
|
|
78
62
|
private loadOrCreateMobileDeviceId;
|
|
79
63
|
private errorToString;
|
|
80
64
|
private isHttpForbidden;
|
|
65
|
+
private isAlreadyBridgedAccessoryError;
|
|
81
66
|
private sleep;
|
|
82
67
|
private isConnectedState;
|
|
83
|
-
private parseCloudConnectionState;
|
|
84
68
|
private refreshDeviceConnectionStates;
|
|
85
69
|
private updateConnectionStateCache;
|
|
86
70
|
private incrementMissingConnectionStateCount;
|
|
87
71
|
private clearMissingConnectionStateCount;
|
|
88
72
|
private findDeviceByCloudSourceId;
|
|
89
73
|
private normalizeCloudIdentifier;
|
|
90
|
-
private captureDeviceStateGenerations;
|
|
91
74
|
private normalizeIntegerConfig;
|
|
92
75
|
private scheduleStartupRetry;
|
|
93
76
|
}
|