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.
Files changed (269) hide show
  1. package/dist/ble.d.ts +10 -0
  2. package/dist/ble.d.ts.map +1 -1
  3. package/dist/ble.js +157 -29
  4. package/dist/ble.js.map +1 -1
  5. package/dist/devices/base.d.ts +45 -0
  6. package/dist/devices/base.d.ts.map +1 -1
  7. package/dist/devices/base.js +116 -0
  8. package/dist/devices/base.js.map +1 -1
  9. package/dist/devices/index.d.ts +7 -0
  10. package/dist/devices/index.d.ts.map +1 -1
  11. package/dist/devices/index.js +7 -0
  12. package/dist/devices/index.js.map +1 -1
  13. package/dist/devices/wo-ai-hub.d.ts +6 -0
  14. package/dist/devices/wo-ai-hub.d.ts.map +1 -0
  15. package/dist/devices/wo-ai-hub.js +7 -0
  16. package/dist/devices/wo-ai-hub.js.map +1 -0
  17. package/dist/devices/wo-air-purifier-pm25.d.ts +6 -0
  18. package/dist/devices/wo-air-purifier-pm25.d.ts.map +1 -0
  19. package/dist/devices/wo-air-purifier-pm25.js +7 -0
  20. package/dist/devices/wo-air-purifier-pm25.js.map +1 -0
  21. package/dist/devices/wo-air-purifier.d.ts +18 -1
  22. package/dist/devices/wo-air-purifier.d.ts.map +1 -1
  23. package/dist/devices/wo-air-purifier.js +74 -10
  24. package/dist/devices/wo-air-purifier.js.map +1 -1
  25. package/dist/devices/wo-blind-tilt.d.ts +1 -0
  26. package/dist/devices/wo-blind-tilt.d.ts.map +1 -1
  27. package/dist/devices/wo-blind-tilt.js +41 -2
  28. package/dist/devices/wo-blind-tilt.js.map +1 -1
  29. package/dist/devices/wo-bulb.d.ts +27 -1
  30. package/dist/devices/wo-bulb.d.ts.map +1 -1
  31. package/dist/devices/wo-bulb.js +124 -34
  32. package/dist/devices/wo-bulb.js.map +1 -1
  33. package/dist/devices/wo-candle-warmer-lamp.d.ts +6 -0
  34. package/dist/devices/wo-candle-warmer-lamp.d.ts.map +1 -0
  35. package/dist/devices/wo-candle-warmer-lamp.js +7 -0
  36. package/dist/devices/wo-candle-warmer-lamp.js.map +1 -0
  37. package/dist/devices/wo-curtain.d.ts +17 -1
  38. package/dist/devices/wo-curtain.d.ts.map +1 -1
  39. package/dist/devices/wo-curtain.js +106 -2
  40. package/dist/devices/wo-curtain.js.map +1 -1
  41. package/dist/devices/wo-hand.d.ts +1 -1
  42. package/dist/devices/wo-hand.d.ts.map +1 -1
  43. package/dist/devices/wo-hand.js +1 -2
  44. package/dist/devices/wo-hand.js.map +1 -1
  45. package/dist/devices/wo-humi.d.ts +17 -1
  46. package/dist/devices/wo-humi.d.ts.map +1 -1
  47. package/dist/devices/wo-humi.js +42 -2
  48. package/dist/devices/wo-humi.js.map +1 -1
  49. package/dist/devices/wo-humi2.d.ts +0 -12
  50. package/dist/devices/wo-humi2.d.ts.map +1 -1
  51. package/dist/devices/wo-humi2.js +0 -18
  52. package/dist/devices/wo-humi2.js.map +1 -1
  53. package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts +6 -0
  54. package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts.map +1 -0
  55. package/dist/devices/wo-pan-tilt-cam-plus-3k.js +7 -0
  56. package/dist/devices/wo-pan-tilt-cam-plus-3k.js.map +1 -0
  57. package/dist/devices/wo-relay-switch-1.d.ts +14 -0
  58. package/dist/devices/wo-relay-switch-1.d.ts.map +1 -1
  59. package/dist/devices/wo-relay-switch-1.js +47 -10
  60. package/dist/devices/wo-relay-switch-1.js.map +1 -1
  61. package/dist/devices/wo-relay-switch-2pm.d.ts.map +1 -1
  62. package/dist/devices/wo-relay-switch-2pm.js +4 -6
  63. package/dist/devices/wo-relay-switch-2pm.js.map +1 -1
  64. package/dist/devices/wo-remote-with-screen.d.ts +6 -0
  65. package/dist/devices/wo-remote-with-screen.d.ts.map +1 -0
  66. package/dist/devices/wo-remote-with-screen.js +7 -0
  67. package/dist/devices/wo-remote-with-screen.js.map +1 -0
  68. package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts +6 -0
  69. package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts.map +1 -0
  70. package/dist/devices/wo-rgbic-neon-wire-rope-light.js +7 -0
  71. package/dist/devices/wo-rgbic-neon-wire-rope-light.js.map +1 -0
  72. package/dist/devices/wo-water-detector.d.ts +6 -0
  73. package/dist/devices/wo-water-detector.d.ts.map +1 -0
  74. package/dist/devices/wo-water-detector.js +7 -0
  75. package/dist/devices/wo-water-detector.js.map +1 -0
  76. package/dist/errors.d.ts +20 -0
  77. package/dist/errors.d.ts.map +1 -1
  78. package/dist/errors.js +31 -1
  79. package/dist/errors.js.map +1 -1
  80. package/dist/index.d.ts +2 -2
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +1 -1
  83. package/dist/index.js.map +1 -1
  84. package/dist/settings.d.ts +5 -0
  85. package/dist/settings.d.ts.map +1 -1
  86. package/dist/settings.js +17 -1
  87. package/dist/settings.js.map +1 -1
  88. package/dist/switchbot.d.ts.map +1 -1
  89. package/dist/switchbot.js +14 -0
  90. package/dist/switchbot.js.map +1 -1
  91. package/dist/types/device.d.ts +28 -3
  92. package/dist/types/device.d.ts.map +1 -1
  93. package/dist/utils/index.d.ts +5 -0
  94. package/dist/utils/index.d.ts.map +1 -1
  95. package/dist/utils/index.js +9 -0
  96. package/dist/utils/index.js.map +1 -1
  97. package/dist/utils/relay-encryption.d.ts +10 -0
  98. package/dist/utils/relay-encryption.d.ts.map +1 -0
  99. package/dist/utils/relay-encryption.js +23 -0
  100. package/dist/utils/relay-encryption.js.map +1 -0
  101. package/dist/utils/retry.d.ts.map +1 -1
  102. package/dist/utils/retry.js +49 -6
  103. package/dist/utils/retry.js.map +1 -1
  104. package/docs/assets/hierarchy.js +1 -1
  105. package/docs/assets/navigation.js +1 -1
  106. package/docs/assets/search.js +1 -1
  107. package/docs/classes/APIError.html +2 -2
  108. package/docs/classes/APINotAvailableError.html +2 -2
  109. package/docs/classes/BLEConnection.html +11 -9
  110. package/docs/classes/BLENotAvailableError.html +2 -2
  111. package/docs/classes/BLEScanner.html +9 -9
  112. package/docs/classes/CommandFailedError.html +2 -2
  113. package/docs/classes/ConnectionTimeoutError.html +2 -2
  114. package/docs/classes/DeviceManager.html +13 -13
  115. package/docs/classes/DeviceNotFoundError.html +2 -2
  116. package/docs/classes/DeviceOverrideStateDuringConnection.html +55 -28
  117. package/docs/classes/DiscoveryError.html +2 -2
  118. package/docs/classes/OpenAPIClient.html +24 -24
  119. package/docs/classes/SequenceDevice.html +56 -29
  120. package/docs/classes/SwitchBot.html +11 -11
  121. package/docs/classes/SwitchBotDevice.html +55 -28
  122. package/docs/classes/SwitchBotError.html +2 -2
  123. package/docs/classes/ValidationError.html +2 -2
  124. package/docs/classes/WoAIHub.html +83 -0
  125. package/docs/classes/WoAirPurifier.html +56 -33
  126. package/docs/classes/WoAirPurifierPM25.html +83 -0
  127. package/docs/classes/WoAirPurifierTable.html +56 -33
  128. package/docs/classes/WoArtFrame.html +67 -35
  129. package/docs/classes/WoBlindTilt.html +63 -34
  130. package/docs/classes/WoBulb.html +67 -35
  131. package/docs/classes/WoCandleWarmerLamp.html +83 -0
  132. package/docs/classes/WoCeilingLight.html +67 -35
  133. package/docs/classes/WoCirculatorFan.html +56 -33
  134. package/docs/classes/WoClimatePanel.html +56 -33
  135. package/docs/classes/WoContact.html +55 -28
  136. package/docs/classes/WoCurtain.html +64 -32
  137. package/docs/classes/WoFloorLamp.html +67 -35
  138. package/docs/classes/WoGarageDoorOpener.html +62 -32
  139. package/docs/classes/WoHand.html +56 -38
  140. package/docs/classes/WoHub2.html +55 -28
  141. package/docs/classes/WoHub3.html +55 -28
  142. package/docs/classes/WoHubMiniMatter.html +55 -28
  143. package/docs/classes/WoHumi.html +58 -32
  144. package/docs/classes/WoHumi2.html +58 -38
  145. package/docs/classes/WoIOSensorTH.html +55 -28
  146. package/docs/classes/WoKeypad.html +55 -28
  147. package/docs/classes/WoKeypadVision.html +55 -28
  148. package/docs/classes/WoKeypadVisionPro.html +55 -28
  149. package/docs/classes/WoLeak.html +55 -28
  150. package/docs/classes/WoPanTiltCamPlus3K.html +83 -0
  151. package/docs/classes/WoPlugMiniJP.html +58 -31
  152. package/docs/classes/WoPlugMiniUS.html +58 -31
  153. package/docs/classes/WoPresence.html +55 -28
  154. package/docs/classes/WoRGBICBulb.html +69 -37
  155. package/docs/classes/WoRGBICNeonWireRopeLight.html +83 -0
  156. package/docs/classes/WoRGBICWWFloorLamp.html +69 -37
  157. package/docs/classes/WoRGBICWWStripLight.html +69 -37
  158. package/docs/classes/WoRelaySwitch1.html +62 -32
  159. package/docs/classes/WoRelaySwitch1PM.html +62 -32
  160. package/docs/classes/WoRelaySwitch2PM.html +64 -34
  161. package/docs/classes/WoRemote.html +55 -28
  162. package/docs/classes/WoRemoteWithScreen.html +83 -0
  163. package/docs/classes/WoRollerShade.html +64 -32
  164. package/docs/classes/WoSensorTH.html +55 -28
  165. package/docs/classes/WoSensorTHPlus.html +55 -28
  166. package/docs/classes/WoSensorTHPro.html +55 -28
  167. package/docs/classes/WoSensorTHProCO2.html +55 -28
  168. package/docs/classes/WoSmartLock.html +58 -31
  169. package/docs/classes/WoSmartLockLite.html +58 -31
  170. package/docs/classes/WoSmartLockPro.html +60 -33
  171. package/docs/classes/WoSmartLockProWiFi.html +60 -33
  172. package/docs/classes/WoSmartLockVision.html +58 -31
  173. package/docs/classes/WoSmartLockVisionPro.html +60 -33
  174. package/docs/classes/WoSmartThermostatRadiator.html +56 -33
  175. package/docs/classes/WoStrip.html +67 -35
  176. package/docs/classes/WoStripLight3.html +67 -35
  177. package/docs/classes/WoVacuum.html +63 -36
  178. package/docs/classes/WoVacuumK10Plus.html +63 -36
  179. package/docs/classes/WoVacuumK10Pro.html +63 -36
  180. package/docs/classes/WoVacuumK10ProCombo.html +63 -36
  181. package/docs/classes/WoVacuumK11Plus.html +63 -36
  182. package/docs/classes/WoVacuumK20.html +63 -36
  183. package/docs/classes/WoVacuumS10.html +63 -36
  184. package/docs/classes/WoVacuumS20.html +63 -36
  185. package/docs/classes/WoWaterDetector.html +83 -0
  186. package/docs/enums/LogLevel.html +2 -2
  187. package/docs/enums/SwitchBotBLEModel.html +2 -2
  188. package/docs/enums/SwitchBotBLEModelName.html +2 -2
  189. package/docs/functions/updateBaseURL.html +1 -1
  190. package/docs/hierarchy.html +1 -1
  191. package/docs/interfaces/APICommandRequest.html +2 -2
  192. package/docs/interfaces/APICommandResponse.html +2 -2
  193. package/docs/interfaces/APIDevice.html +2 -2
  194. package/docs/interfaces/APIDeviceStatus.html +2 -2
  195. package/docs/interfaces/APIErrorResponse.html +2 -2
  196. package/docs/interfaces/APIResponse.html +2 -2
  197. package/docs/interfaces/AirPurifierCommands.html +3 -2
  198. package/docs/interfaces/AirPurifierServiceData.html +14 -14
  199. package/docs/interfaces/AirPurifierStatus.html +7 -7
  200. package/docs/interfaces/BLEAdvertisement.html +2 -2
  201. package/docs/interfaces/BLEScanOptions.html +5 -5
  202. package/docs/interfaces/BLEServiceData.html +14 -14
  203. package/docs/interfaces/BlindTiltCommands.html +2 -2
  204. package/docs/interfaces/BlindTiltServiceData.html +14 -14
  205. package/docs/interfaces/BlindTiltStatus.html +7 -6
  206. package/docs/interfaces/BotCommands.html +2 -2
  207. package/docs/interfaces/BotServiceData.html +14 -14
  208. package/docs/interfaces/BotStatus.html +6 -6
  209. package/docs/interfaces/BulbCommands.html +4 -2
  210. package/docs/interfaces/BulbServiceData.html +14 -14
  211. package/docs/interfaces/BulbStatus.html +6 -6
  212. package/docs/interfaces/CeilingLightCommands.html +4 -2
  213. package/docs/interfaces/CeilingLightServiceData.html +14 -14
  214. package/docs/interfaces/CeilingLightStatus.html +6 -6
  215. package/docs/interfaces/CommandResult.html +6 -6
  216. package/docs/interfaces/ContactServiceData.html +14 -14
  217. package/docs/interfaces/ContactStatus.html +6 -6
  218. package/docs/interfaces/CurtainCommands.html +5 -2
  219. package/docs/interfaces/CurtainExtendedInfo.html +4 -0
  220. package/docs/interfaces/CurtainServiceData.html +14 -14
  221. package/docs/interfaces/CurtainStatus.html +6 -6
  222. package/docs/interfaces/DeviceInfo.html +18 -18
  223. package/docs/interfaces/DeviceListResponse.html +2 -2
  224. package/docs/interfaces/DeviceStatus.html +6 -6
  225. package/docs/interfaces/DiscoveryOptions.html +7 -7
  226. package/docs/interfaces/HubServiceData.html +14 -14
  227. package/docs/interfaces/HubStatus.html +6 -6
  228. package/docs/interfaces/HumidifierCommands.html +6 -2
  229. package/docs/interfaces/HumidifierServiceData.html +15 -15
  230. package/docs/interfaces/HumidifierStatus.html +6 -6
  231. package/docs/interfaces/KeypadStatus.html +6 -6
  232. package/docs/interfaces/LeakServiceData.html +14 -14
  233. package/docs/interfaces/LeakStatus.html +6 -6
  234. package/docs/interfaces/LockCommands.html +2 -2
  235. package/docs/interfaces/LockServiceData.html +15 -15
  236. package/docs/interfaces/LockStatus.html +6 -6
  237. package/docs/interfaces/MeterServiceData.html +14 -14
  238. package/docs/interfaces/MeterStatus.html +6 -6
  239. package/docs/interfaces/MotionServiceData.html +14 -14
  240. package/docs/interfaces/MotionStatus.html +6 -6
  241. package/docs/interfaces/PlugCommands.html +2 -2
  242. package/docs/interfaces/PlugServiceData.html +14 -14
  243. package/docs/interfaces/PlugStatus.html +6 -6
  244. package/docs/interfaces/PresenceServiceData.html +14 -14
  245. package/docs/interfaces/PresenceStatus.html +6 -6
  246. package/docs/interfaces/RelaySwitchCommands.html +2 -2
  247. package/docs/interfaces/RelaySwitchServiceData.html +14 -14
  248. package/docs/interfaces/RelaySwitchStatus.html +6 -6
  249. package/docs/interfaces/RemoteStatus.html +6 -6
  250. package/docs/interfaces/SceneListResponse.html +2 -2
  251. package/docs/interfaces/StripCommands.html +4 -2
  252. package/docs/interfaces/StripServiceData.html +14 -14
  253. package/docs/interfaces/StripStatus.html +6 -6
  254. package/docs/interfaces/SwitchBotConfig.html +15 -15
  255. package/docs/interfaces/VacuumCommands.html +2 -2
  256. package/docs/interfaces/VacuumStatus.html +6 -6
  257. package/docs/interfaces/WebhookConfig.html +2 -2
  258. package/docs/interfaces/WebhookDetails.html +2 -2
  259. package/docs/interfaces/WebhookQueryResponse.html +2 -2
  260. package/docs/interfaces/WebhookSetupResponse.html +2 -2
  261. package/docs/modules.html +1 -1
  262. package/docs/types/ConnectionType.html +1 -1
  263. package/docs/types/PhysicalDeviceType.html +1 -1
  264. package/docs/types/VirtualDeviceType.html +1 -1
  265. package/docs/variables/urls.html +1 -1
  266. package/package.json +2 -2
  267. package/todo/PYSWITCHBOT_COMPARISON.md +5 -9
  268. package/todo/completed.md +179 -0
  269. 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
- ### Relay Switch Commands
19
-
20
- ### ✨ Advanced Features
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
- - [x] **Task 12.1**: K10+ Vacuum ✅
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
- ### 🎛️ Other Devices
44
+ ### Advanced Features
67
45
 
68
- **Phase 3 Other Devices block completed!** See `todo/completed.md` for task details.
46
+ - ✅ Phase 2 completed. See `todo/completed.md` for completed task details.
69
47
 
70
48
  ---
71
49
 
72
- ### Completed in Phase 3
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
- 1. **Climate Control**
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
- - [ ] **Task 3.2**: Add Curtain 3 specific commands
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
- - [ ] **Task 7.1**: Add humidity level control
110
- - `setLevel(level: number)` - Set target humidity (1-100)
111
- - Command: `0x57 0x0F 0xXX 0x01 LEVEL` (XX varies by model)
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
- - [ ] **Task 8.1**: Add preset modes
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
- - [ ] **Task 8.2**: Add status with AQI/PM2.5
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
- - [ ] **Task 18.8**: Implement key verification
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
- - [ ] **Task 10.4**: Add direction detection for covers
172
- - Track `_is_opening` / `_is_closing` states
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
- - [ ] **Task 19.4**: Enhance retry logic
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
- - [ ] **Task 19.5**: Add response length validation
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
- - [ ] **Task 20.3**: Implement command batching
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
- - [ ] **Task 20.4**: Add expected disconnect tracking
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)