node-switchbot 4.0.0-beta.11 → 4.0.0-beta.13
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/ble.d.ts +10 -0
- package/dist/ble.d.ts.map +1 -1
- package/dist/ble.js +157 -29
- package/dist/ble.js.map +1 -1
- package/dist/devices/base.d.ts +45 -0
- package/dist/devices/base.d.ts.map +1 -1
- package/dist/devices/base.js +116 -0
- package/dist/devices/base.js.map +1 -1
- package/dist/devices/index.d.ts +7 -0
- package/dist/devices/index.d.ts.map +1 -1
- package/dist/devices/index.js +7 -0
- package/dist/devices/index.js.map +1 -1
- package/dist/devices/wo-ai-hub.d.ts +6 -0
- package/dist/devices/wo-ai-hub.d.ts.map +1 -0
- package/dist/devices/wo-ai-hub.js +7 -0
- package/dist/devices/wo-ai-hub.js.map +1 -0
- package/dist/devices/wo-air-purifier-pm25.d.ts +6 -0
- package/dist/devices/wo-air-purifier-pm25.d.ts.map +1 -0
- package/dist/devices/wo-air-purifier-pm25.js +7 -0
- package/dist/devices/wo-air-purifier-pm25.js.map +1 -0
- package/dist/devices/wo-air-purifier.d.ts +18 -1
- package/dist/devices/wo-air-purifier.d.ts.map +1 -1
- package/dist/devices/wo-air-purifier.js +74 -10
- package/dist/devices/wo-air-purifier.js.map +1 -1
- package/dist/devices/wo-blind-tilt.d.ts +1 -0
- package/dist/devices/wo-blind-tilt.d.ts.map +1 -1
- package/dist/devices/wo-blind-tilt.js +41 -2
- package/dist/devices/wo-blind-tilt.js.map +1 -1
- package/dist/devices/wo-bulb.d.ts +27 -1
- package/dist/devices/wo-bulb.d.ts.map +1 -1
- package/dist/devices/wo-bulb.js +124 -34
- package/dist/devices/wo-bulb.js.map +1 -1
- package/dist/devices/wo-candle-warmer-lamp.d.ts +6 -0
- package/dist/devices/wo-candle-warmer-lamp.d.ts.map +1 -0
- package/dist/devices/wo-candle-warmer-lamp.js +7 -0
- package/dist/devices/wo-candle-warmer-lamp.js.map +1 -0
- package/dist/devices/wo-curtain.d.ts +17 -1
- package/dist/devices/wo-curtain.d.ts.map +1 -1
- package/dist/devices/wo-curtain.js +106 -2
- package/dist/devices/wo-curtain.js.map +1 -1
- package/dist/devices/wo-hand.d.ts +1 -1
- package/dist/devices/wo-hand.d.ts.map +1 -1
- package/dist/devices/wo-hand.js +1 -2
- package/dist/devices/wo-hand.js.map +1 -1
- package/dist/devices/wo-humi.d.ts +17 -1
- package/dist/devices/wo-humi.d.ts.map +1 -1
- package/dist/devices/wo-humi.js +42 -2
- package/dist/devices/wo-humi.js.map +1 -1
- package/dist/devices/wo-humi2.d.ts +0 -12
- package/dist/devices/wo-humi2.d.ts.map +1 -1
- package/dist/devices/wo-humi2.js +0 -18
- package/dist/devices/wo-humi2.js.map +1 -1
- package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts +6 -0
- package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts.map +1 -0
- package/dist/devices/wo-pan-tilt-cam-plus-3k.js +7 -0
- package/dist/devices/wo-pan-tilt-cam-plus-3k.js.map +1 -0
- package/dist/devices/wo-relay-switch-1.d.ts +14 -0
- package/dist/devices/wo-relay-switch-1.d.ts.map +1 -1
- package/dist/devices/wo-relay-switch-1.js +47 -10
- package/dist/devices/wo-relay-switch-1.js.map +1 -1
- package/dist/devices/wo-relay-switch-2pm.d.ts.map +1 -1
- package/dist/devices/wo-relay-switch-2pm.js +4 -6
- package/dist/devices/wo-relay-switch-2pm.js.map +1 -1
- package/dist/devices/wo-remote-with-screen.d.ts +6 -0
- package/dist/devices/wo-remote-with-screen.d.ts.map +1 -0
- package/dist/devices/wo-remote-with-screen.js +7 -0
- package/dist/devices/wo-remote-with-screen.js.map +1 -0
- package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts +6 -0
- package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts.map +1 -0
- package/dist/devices/wo-rgbic-neon-wire-rope-light.js +7 -0
- package/dist/devices/wo-rgbic-neon-wire-rope-light.js.map +1 -0
- package/dist/devices/wo-water-detector.d.ts +6 -0
- package/dist/devices/wo-water-detector.d.ts.map +1 -0
- package/dist/devices/wo-water-detector.js +7 -0
- package/dist/devices/wo-water-detector.js.map +1 -0
- package/dist/errors.d.ts +20 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +31 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/settings.d.ts +5 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +17 -1
- package/dist/settings.js.map +1 -1
- package/dist/switchbot.d.ts.map +1 -1
- package/dist/switchbot.js +14 -0
- package/dist/switchbot.js.map +1 -1
- package/dist/types/device.d.ts +28 -3
- package/dist/types/device.d.ts.map +1 -1
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/relay-encryption.d.ts +10 -0
- package/dist/utils/relay-encryption.d.ts.map +1 -0
- package/dist/utils/relay-encryption.js +23 -0
- package/dist/utils/relay-encryption.js.map +1 -0
- package/dist/utils/retry.d.ts.map +1 -1
- package/dist/utils/retry.js +49 -6
- package/dist/utils/retry.js.map +1 -1
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/APIError.html +2 -2
- package/docs/classes/APINotAvailableError.html +2 -2
- package/docs/classes/BLEConnection.html +11 -9
- package/docs/classes/BLENotAvailableError.html +2 -2
- package/docs/classes/BLEScanner.html +9 -9
- package/docs/classes/CommandFailedError.html +2 -2
- package/docs/classes/ConnectionTimeoutError.html +2 -2
- package/docs/classes/DeviceManager.html +13 -13
- package/docs/classes/DeviceNotFoundError.html +2 -2
- package/docs/classes/DeviceOverrideStateDuringConnection.html +55 -28
- package/docs/classes/DiscoveryError.html +2 -2
- package/docs/classes/OpenAPIClient.html +24 -24
- package/docs/classes/SequenceDevice.html +56 -29
- package/docs/classes/SwitchBot.html +11 -11
- package/docs/classes/SwitchBotDevice.html +55 -28
- package/docs/classes/SwitchBotError.html +2 -2
- package/docs/classes/ValidationError.html +2 -2
- package/docs/classes/WoAIHub.html +83 -0
- package/docs/classes/WoAirPurifier.html +56 -33
- package/docs/classes/WoAirPurifierPM25.html +83 -0
- package/docs/classes/WoAirPurifierTable.html +56 -33
- package/docs/classes/WoArtFrame.html +67 -35
- package/docs/classes/WoBlindTilt.html +63 -34
- package/docs/classes/WoBulb.html +67 -35
- package/docs/classes/WoCandleWarmerLamp.html +83 -0
- package/docs/classes/WoCeilingLight.html +67 -35
- package/docs/classes/WoCirculatorFan.html +56 -33
- package/docs/classes/WoClimatePanel.html +56 -33
- package/docs/classes/WoContact.html +55 -28
- package/docs/classes/WoCurtain.html +64 -32
- package/docs/classes/WoFloorLamp.html +67 -35
- package/docs/classes/WoGarageDoorOpener.html +62 -32
- package/docs/classes/WoHand.html +56 -38
- package/docs/classes/WoHub2.html +55 -28
- package/docs/classes/WoHub3.html +55 -28
- package/docs/classes/WoHubMiniMatter.html +55 -28
- package/docs/classes/WoHumi.html +58 -32
- package/docs/classes/WoHumi2.html +58 -38
- package/docs/classes/WoIOSensorTH.html +55 -28
- package/docs/classes/WoKeypad.html +55 -28
- package/docs/classes/WoKeypadVision.html +55 -28
- package/docs/classes/WoKeypadVisionPro.html +55 -28
- package/docs/classes/WoLeak.html +55 -28
- package/docs/classes/WoPanTiltCamPlus3K.html +83 -0
- package/docs/classes/WoPlugMiniJP.html +58 -31
- package/docs/classes/WoPlugMiniUS.html +58 -31
- package/docs/classes/WoPresence.html +55 -28
- package/docs/classes/WoRGBICBulb.html +69 -37
- package/docs/classes/WoRGBICNeonWireRopeLight.html +83 -0
- package/docs/classes/WoRGBICWWFloorLamp.html +69 -37
- package/docs/classes/WoRGBICWWStripLight.html +69 -37
- package/docs/classes/WoRelaySwitch1.html +62 -32
- package/docs/classes/WoRelaySwitch1PM.html +62 -32
- package/docs/classes/WoRelaySwitch2PM.html +64 -34
- package/docs/classes/WoRemote.html +55 -28
- package/docs/classes/WoRemoteWithScreen.html +83 -0
- package/docs/classes/WoRollerShade.html +64 -32
- package/docs/classes/WoSensorTH.html +55 -28
- package/docs/classes/WoSensorTHPlus.html +55 -28
- package/docs/classes/WoSensorTHPro.html +55 -28
- package/docs/classes/WoSensorTHProCO2.html +55 -28
- package/docs/classes/WoSmartLock.html +58 -31
- package/docs/classes/WoSmartLockLite.html +58 -31
- package/docs/classes/WoSmartLockPro.html +60 -33
- package/docs/classes/WoSmartLockProWiFi.html +60 -33
- package/docs/classes/WoSmartLockVision.html +58 -31
- package/docs/classes/WoSmartLockVisionPro.html +60 -33
- package/docs/classes/WoSmartThermostatRadiator.html +56 -33
- package/docs/classes/WoStrip.html +67 -35
- package/docs/classes/WoStripLight3.html +67 -35
- package/docs/classes/WoVacuum.html +63 -36
- package/docs/classes/WoVacuumK10Plus.html +63 -36
- package/docs/classes/WoVacuumK10Pro.html +63 -36
- package/docs/classes/WoVacuumK10ProCombo.html +63 -36
- package/docs/classes/WoVacuumK11Plus.html +63 -36
- package/docs/classes/WoVacuumK20.html +63 -36
- package/docs/classes/WoVacuumS10.html +63 -36
- package/docs/classes/WoVacuumS20.html +63 -36
- package/docs/classes/WoWaterDetector.html +83 -0
- package/docs/enums/LogLevel.html +2 -2
- package/docs/enums/SwitchBotBLEModel.html +2 -2
- package/docs/enums/SwitchBotBLEModelName.html +2 -2
- package/docs/functions/updateBaseURL.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/APICommandRequest.html +2 -2
- package/docs/interfaces/APICommandResponse.html +2 -2
- package/docs/interfaces/APIDevice.html +2 -2
- package/docs/interfaces/APIDeviceStatus.html +2 -2
- package/docs/interfaces/APIErrorResponse.html +2 -2
- package/docs/interfaces/APIResponse.html +2 -2
- package/docs/interfaces/AirPurifierCommands.html +3 -2
- package/docs/interfaces/AirPurifierServiceData.html +14 -14
- package/docs/interfaces/AirPurifierStatus.html +7 -7
- package/docs/interfaces/BLEAdvertisement.html +2 -2
- package/docs/interfaces/BLEScanOptions.html +5 -5
- package/docs/interfaces/BLEServiceData.html +14 -14
- package/docs/interfaces/BlindTiltCommands.html +2 -2
- package/docs/interfaces/BlindTiltServiceData.html +14 -14
- package/docs/interfaces/BlindTiltStatus.html +7 -6
- package/docs/interfaces/BotCommands.html +2 -2
- package/docs/interfaces/BotServiceData.html +14 -14
- package/docs/interfaces/BotStatus.html +6 -6
- package/docs/interfaces/BulbCommands.html +4 -2
- package/docs/interfaces/BulbServiceData.html +14 -14
- package/docs/interfaces/BulbStatus.html +6 -6
- package/docs/interfaces/CeilingLightCommands.html +4 -2
- package/docs/interfaces/CeilingLightServiceData.html +14 -14
- package/docs/interfaces/CeilingLightStatus.html +6 -6
- package/docs/interfaces/CommandResult.html +6 -6
- package/docs/interfaces/ContactServiceData.html +14 -14
- package/docs/interfaces/ContactStatus.html +6 -6
- package/docs/interfaces/CurtainCommands.html +5 -2
- package/docs/interfaces/CurtainExtendedInfo.html +4 -0
- package/docs/interfaces/CurtainServiceData.html +14 -14
- package/docs/interfaces/CurtainStatus.html +6 -6
- package/docs/interfaces/DeviceInfo.html +18 -18
- package/docs/interfaces/DeviceListResponse.html +2 -2
- package/docs/interfaces/DeviceStatus.html +6 -6
- package/docs/interfaces/DiscoveryOptions.html +7 -7
- package/docs/interfaces/HubServiceData.html +14 -14
- package/docs/interfaces/HubStatus.html +6 -6
- package/docs/interfaces/HumidifierCommands.html +6 -2
- package/docs/interfaces/HumidifierServiceData.html +15 -15
- package/docs/interfaces/HumidifierStatus.html +6 -6
- package/docs/interfaces/KeypadStatus.html +6 -6
- package/docs/interfaces/LeakServiceData.html +14 -14
- package/docs/interfaces/LeakStatus.html +6 -6
- package/docs/interfaces/LockCommands.html +2 -2
- package/docs/interfaces/LockServiceData.html +15 -15
- package/docs/interfaces/LockStatus.html +6 -6
- package/docs/interfaces/MeterServiceData.html +14 -14
- package/docs/interfaces/MeterStatus.html +6 -6
- package/docs/interfaces/MotionServiceData.html +14 -14
- package/docs/interfaces/MotionStatus.html +6 -6
- package/docs/interfaces/PlugCommands.html +2 -2
- package/docs/interfaces/PlugServiceData.html +14 -14
- package/docs/interfaces/PlugStatus.html +6 -6
- package/docs/interfaces/PresenceServiceData.html +14 -14
- package/docs/interfaces/PresenceStatus.html +6 -6
- package/docs/interfaces/RelaySwitchCommands.html +2 -2
- package/docs/interfaces/RelaySwitchServiceData.html +14 -14
- package/docs/interfaces/RelaySwitchStatus.html +6 -6
- package/docs/interfaces/RemoteStatus.html +6 -6
- package/docs/interfaces/SceneListResponse.html +2 -2
- package/docs/interfaces/StripCommands.html +4 -2
- package/docs/interfaces/StripServiceData.html +14 -14
- package/docs/interfaces/StripStatus.html +6 -6
- package/docs/interfaces/SwitchBotConfig.html +15 -15
- package/docs/interfaces/VacuumCommands.html +2 -2
- package/docs/interfaces/VacuumStatus.html +6 -6
- package/docs/interfaces/WebhookConfig.html +2 -2
- package/docs/interfaces/WebhookDetails.html +2 -2
- package/docs/interfaces/WebhookQueryResponse.html +2 -2
- package/docs/interfaces/WebhookSetupResponse.html +2 -2
- package/docs/modules.html +1 -1
- package/docs/types/ConnectionType.html +1 -1
- package/docs/types/PhysicalDeviceType.html +1 -1
- package/docs/types/VirtualDeviceType.html +1 -1
- package/docs/variables/urls.html +1 -1
- package/package.json +2 -2
- package/todo/PYSWITCHBOT_COMPARISON.md +5 -9
- package/todo/completed.md +179 -0
- package/todo/todo.md +54 -122
package/todo/todo.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Completed
|
|
2
|
+
|
|
3
|
+
- [x] Enhance retry logic: DBus backoff, BLEAK exceptions, error context
|
|
4
|
+
- [x] Add/expand tests for retry logic (DBus, BLEAK, error context)
|
|
5
|
+
- [x] Add response length validation (min length, error for truncated, actual vs expected)
|
|
6
|
+
- [x] Implement command batching (queue, sequence, share connection)
|
|
7
|
+
- [x] Implement expected disconnect tracking (track disconnects that are expected as part of command flow)
|
|
8
|
+
|
|
9
|
+
# Next
|
|
10
|
+
|
|
11
|
+
- [x] Implement notification handling (per-command notification futures, timeout, unsolicited log)
|
|
1
12
|
# TODO: pySwitchBot Feature Parity Roadmap
|
|
2
13
|
|
|
3
14
|
Implementation tasks to achieve feature parity with pySwitchBot.
|
|
@@ -13,75 +24,32 @@ Source: [PYSWITCHBOT_COMPARISON.md](./PYSWITCHBOT_COMPARISON.md)
|
|
|
13
24
|
|
|
14
25
|
### 🔒 Lock Commands
|
|
15
26
|
|
|
27
|
+
<!-- Task 18.8 moved to completed.md -->
|
|
16
28
|
### 💡 Light (Bulb/Strip) Commands
|
|
17
29
|
|
|
18
|
-
###
|
|
19
|
-
|
|
20
|
-
|
|
30
|
+
### Task 18.8: Implement key verification ✅
|
|
31
|
+
**Completed: March 7, 2026**
|
|
32
|
+
**Implementation Details:**
|
|
33
|
+
- Added verifyEncryptionKey() to WoRelaySwitch1, WoAirPurifier, WoBulb (and WoStrip).
|
|
34
|
+
- Method attempts a BLE command with the provided encryption key and throws a clear error if the key is invalid or rejected by the device.
|
|
35
|
+
- Ensures users get immediate feedback on key validity before encrypted operations.
|
|
36
|
+
- Validated by build, test, and lint cycle.
|
|
37
|
+
- See PR/commit: Task 18.8 implementation, March 7, 2026.
|
|
21
38
|
|
|
22
|
-
- ✅ Phase 2 completed. See `todo/completed.md` for completed task details.
|
|
23
39
|
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## 📅 Phase 3: New Devices (Q3 2026)
|
|
27
40
|
|
|
28
|
-
### 🧹 Vacuum Cleaners
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
- [x] **Task 12.2**: K10+ Pro Vacuum ✅
|
|
32
|
-
- [x] **Task 12.3**: K10+ Pro Combo Vacuum ✅
|
|
33
|
-
- [x] **Task 12.4**: K11+ Vacuum ✅
|
|
34
|
-
- [x] **Task 12.5**: K20 Vacuum ✅
|
|
35
|
-
- [x] **Task 12.6**: S10 Vacuum ✅
|
|
36
|
-
- [x] **Task 12.7**: S20 Vacuum ✅
|
|
37
|
-
|
|
38
|
-
#### Vacuum Commands
|
|
39
|
-
- [x] **Task 9.2**: Add basic vacuum commands ✅
|
|
40
|
-
- `cleanUp(protocolVersion: number)` - Start cleaning
|
|
41
|
-
- `returnToDock(protocolVersion: number)` - Return to base
|
|
42
|
-
- Support protocol versions 1 and 2
|
|
43
|
-
|
|
44
|
-
- [x] **Task 9.3**: Add vacuum status getters ✅
|
|
45
|
-
- Battery level
|
|
46
|
-
- Work status (cleaning, returning, docked, etc.)
|
|
47
|
-
- Dustbin status
|
|
48
|
-
- Network status
|
|
49
|
-
|
|
50
|
-
### 🔐 Lock Variants
|
|
51
|
-
|
|
52
|
-
- [x] **Task 13.1**: Lock Lite ✅
|
|
53
|
-
- [x] **Task 13.2**: Lock Vision ✅
|
|
54
|
-
- [x] **Task 13.3**: Lock Vision Pro ✅
|
|
55
|
-
- [x] **Task 13.4**: Lock Pro WiFi ✅
|
|
56
|
-
|
|
57
|
-
### ⚡ Power & Climate
|
|
58
|
-
|
|
59
|
-
- [x] **Task 14.1**: Relay Switch 2PM ✅
|
|
60
|
-
- [x] **Task 14.2**: Garage Door Opener (relay variant) ✅
|
|
61
|
-
- [x] **Task 15.1**: Evaporative Humidifier (WoHumi2) - Already exists, enhance ✅
|
|
62
|
-
- [x] **Task 15.2**: Circulator Fan (Battery/USB) ✅
|
|
63
|
-
- [x] **Task 15.3**: Smart Thermostat Radiator ✅
|
|
64
|
-
- [x] **Task 15.4**: Climate Panel ✅
|
|
42
|
+
### ⚡ Relay Switch Commands
|
|
65
43
|
|
|
66
|
-
###
|
|
44
|
+
### ✨ Advanced Features
|
|
67
45
|
|
|
68
|
-
✅
|
|
46
|
+
- ✅ Phase 2 completed. See `todo/completed.md` for completed task details.
|
|
69
47
|
|
|
70
48
|
---
|
|
71
49
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- [x] **Task 10.1**: Implement passive status from advertisements ✅
|
|
75
|
-
- [x] **Task 10.2**: Add sequence number tracking ✅
|
|
76
|
-
|
|
77
|
-
### 🎯 Next Steps (Phase 3)
|
|
50
|
+
## 📅 Phase 3: New Devices (Q3 2026)
|
|
78
51
|
|
|
79
|
-
|
|
80
|
-
- Climate control block complete ✅
|
|
81
|
-
2. **Lighting Variants**
|
|
82
|
-
- Tasks 16.1-16.5: Strip Light 3, Floor Lamp, RGBICWW Strip/Floor, Art Frame
|
|
83
|
-
3. **Other Devices**
|
|
84
|
-
- Tasks 17.1-17.6: Plug Mini EU verify, Roller Shade, Keypad Vision/Pro, Hub3 enhance, HubMini Matter
|
|
52
|
+
✅ **Phase 3 completed!** All vacuum cleaners, lock variants, power/climate devices, lighting variants, and other devices implemented. See `todo/completed.md` for detailed task completion records.
|
|
85
53
|
|
|
86
54
|
---
|
|
87
55
|
|
|
@@ -89,64 +57,32 @@ Source: [PYSWITCHBOT_COMPARISON.md](./PYSWITCHBOT_COMPARISON.md)
|
|
|
89
57
|
|
|
90
58
|
### 🎨 Enhanced Device Control
|
|
91
59
|
|
|
92
|
-
-
|
|
93
|
-
- Support Curtain 3 model detection
|
|
94
|
-
- Implement multi-command sequences
|
|
95
|
-
- Add extended info retrieval
|
|
96
|
-
|
|
97
|
-
- [ ] **Task 3.3**: Add `getExtendedInfo()` command for curtains
|
|
98
|
-
- Returns device chain information
|
|
99
|
-
- Grouped curtain status
|
|
100
|
-
- Command: `0x57 0x0F 0x46 0x01`
|
|
101
|
-
|
|
102
|
-
- [ ] **Task 6.4**: Implement multi-command sequences for lights
|
|
103
|
-
- Send multiple commands in series
|
|
104
|
-
- Used for complex light patterns
|
|
105
|
-
- Support for Strip Light 3
|
|
60
|
+
- ✅ Task 6.4 completed. See `todo/completed.md` for implementation details.
|
|
106
61
|
|
|
107
62
|
### 💧 Humidifier Commands
|
|
108
63
|
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
64
|
+
- ✅ Task 7.1 completed. See `todo/completed.md` for implementation details.
|
|
65
|
+
|
|
66
|
+
<!-- Task 7.2 moved to completed.md -->
|
|
112
67
|
|
|
113
|
-
- [ ] **Task 7.2**: Add mode control
|
|
114
|
-
- `setAuto()` - Automatic mode
|
|
115
|
-
- `setManual()` - Manual mode
|
|
116
|
-
- Get target humidity level
|
|
117
68
|
|
|
118
69
|
### 🌬️ Air Purifier Commands
|
|
119
70
|
|
|
120
|
-
|
|
121
|
-
- Modes: `level_1`, `level_2`, `level_3`, `auto`, `sleep`, `pet`
|
|
122
|
-
- `setPresetMode(mode: string)`
|
|
123
|
-
- Command: `0x57 0x0F 0x4E 0x01 MODE_ID`
|
|
71
|
+
<!-- Task 8.1 moved to completed.md -->
|
|
124
72
|
|
|
125
|
-
|
|
126
|
-
- Parse air quality index from response
|
|
127
|
-
- PM2.5 levels
|
|
128
|
-
- Fan speed and mode
|
|
73
|
+
<!-- Task 8.2 moved to completed.md -->
|
|
129
74
|
|
|
130
75
|
### 🔐 Encryption Enhancements
|
|
131
76
|
|
|
132
|
-
- [ ] **Task 18.4**: Add encryption for relay switches
|
|
133
|
-
- Newer relay switches require encryption
|
|
134
|
-
- Same key retrieval process as locks
|
|
135
77
|
|
|
136
|
-
- [ ] **Task 18.5**: Add encryption for air purifiers
|
|
137
|
-
- Newer air purifiers require encryption
|
|
138
|
-
- Command encryption for all control commands
|
|
139
78
|
|
|
140
|
-
- [ ] **Task 18.6**: Add encryption for light strips
|
|
141
|
-
- Newer light strips require encryption
|
|
142
|
-
- Effect commands need encryption
|
|
143
79
|
|
|
144
|
-
- [ ] **Task 18.7**: Add encryption state reset on disconnect
|
|
145
|
-
- Clear IV, cipher, encryption mode
|
|
146
|
-
- Re-initialize on next connection
|
|
147
|
-
- Handle firmware updates that change encryption
|
|
148
80
|
|
|
149
|
-
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
<!-- Task 18.7 moved to completed.md -->
|
|
84
|
+
|
|
85
|
+
- [x] **Task 18.8**: Implement key verification
|
|
150
86
|
- `verifyEncryptionKey()` - Test key validity
|
|
151
87
|
- Try commands with key before assuming valid
|
|
152
88
|
- Better error messages for invalid keys
|
|
@@ -163,44 +99,35 @@ Source: [PYSWITCHBOT_COMPARISON.md](./PYSWITCHBOT_COMPARISON.md)
|
|
|
163
99
|
- Auto-trigger status update when sequence changes
|
|
164
100
|
- Implement for: locks, relay switches, vacuums, air purifiers
|
|
165
101
|
|
|
166
|
-
- [ ] **Task 10.3**: Add calibration status tracking
|
|
167
|
-
- Parse calibration bit from advertisements
|
|
168
|
-
- Track for: curtains, blind tilts
|
|
169
|
-
- Warn if device not calibrated
|
|
170
102
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
- Update based on position changes
|
|
174
|
-
- Help UI show proper icons
|
|
103
|
+
|
|
104
|
+
|
|
175
105
|
|
|
176
106
|
### 🔗 Connection & Error Improvements
|
|
177
107
|
|
|
178
|
-
- [ ] **Task 19.1**: Add specific BLE exceptions
|
|
179
|
-
- `SwitchbotOperationError` - Operation failures
|
|
180
|
-
- `SwitchbotAuthenticationError` - Auth failures
|
|
181
|
-
- `CharacteristicMissingError` - BLE characteristic missing
|
|
182
108
|
|
|
183
|
-
|
|
109
|
+
|
|
110
|
+
- [x] **Task 19.4**: Enhance retry logic
|
|
184
111
|
- DBus error backoff (0.25s)
|
|
185
112
|
- `BLEAK_RETRY_EXCEPTIONS` handling
|
|
186
113
|
- Better context in retry errors
|
|
187
114
|
|
|
188
|
-
- [
|
|
115
|
+
- [x] **Task 19.5**: Add response length validation ✅
|
|
189
116
|
- Check minimum expected length
|
|
190
117
|
- Throw errors for truncated responses
|
|
191
118
|
- Include actual vs expected length in error
|
|
192
119
|
|
|
193
|
-
- [
|
|
120
|
+
- [x] **Task 20.3**: Implement command batching ✅
|
|
194
121
|
- Queue multiple commands
|
|
195
122
|
- Send in sequence on single connection
|
|
196
123
|
- Share connection overhead
|
|
197
124
|
|
|
198
|
-
- [
|
|
125
|
+
- [x] **Task 20.4**: Add expected disconnect tracking ✅
|
|
199
126
|
- `_expected_disconnect` flag
|
|
200
127
|
- Differentiate expected vs unexpected disconnects
|
|
201
128
|
- Better error handling for unexpected disconnects
|
|
202
129
|
|
|
203
|
-
- [ ] **Task 20.5**: Implement notification handling
|
|
130
|
+
- [ ] **Task 20.5**: Implement notification handling ⏳
|
|
204
131
|
- Per-command notification futures
|
|
205
132
|
- Timeout handling (5s default)
|
|
206
133
|
- Log unsolicited notifications
|
|
@@ -217,11 +144,6 @@ Source: [PYSWITCHBOT_COMPARISON.md](./PYSWITCHBOT_COMPARISON.md)
|
|
|
217
144
|
- `sendCommandSequence()` - Send series, must all succeed
|
|
218
145
|
- Used for Curtain 3 and newer devices
|
|
219
146
|
|
|
220
|
-
- [ ] **Task 21.4**: Implement basic settings command
|
|
221
|
-
- `getBasicInfo()` - Universal settings retrieval
|
|
222
|
-
- Returns: battery, firmware, device-specific settings
|
|
223
|
-
- Command: `0x57 0x02`
|
|
224
|
-
|
|
225
147
|
- [ ] **Task 21.5**: Add mode setting commands
|
|
226
148
|
- Universal mode setting command: `0x57 0x03`
|
|
227
149
|
- Extended settings command
|
|
@@ -300,3 +222,13 @@ Source: [PYSWITCHBOT_COMPARISON.md](./PYSWITCHBOT_COMPARISON.md)
|
|
|
300
222
|
- Full comparison details: [PYSWITCHBOT_COMPARISON.md](../PYSWITCHBOT_COMPARISON.md)
|
|
301
223
|
- pySwitchBot Repository: https://github.com/Danielhiversen/pySwitchbot
|
|
302
224
|
- SwitchBot BLE API: https://github.com/OpenWonderLabs/SwitchBotAPI-BLE
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## 📋 Todo List
|
|
229
|
+
|
|
230
|
+
- [x] Enhance retry logic: DBus backoff, BLEAK exceptions, error context
|
|
231
|
+
- [x] Add/expand tests for retry logic (DBus, BLEAK, error context)
|
|
232
|
+
- [x] Add response length validation (min length, error for truncated, actual vs expected)
|
|
233
|
+
- [x] Implement command batching (queue, sequence, share connection)
|
|
234
|
+
- [x] Implement expected disconnect tracking (track disconnects that are expected as part of command flow)
|