node-switchbot 4.0.0-beta.1 → 4.0.0-beta.11

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 (379) hide show
  1. package/.github/copilot-instructions.md +19 -5
  2. package/BLE.md +117 -4
  3. package/CHANGELOG.md +45 -0
  4. package/README.md +7 -1
  5. package/dist/api.d.ts +3 -3
  6. package/dist/api.d.ts.map +1 -1
  7. package/dist/api.js +9 -6
  8. package/dist/api.js.map +1 -1
  9. package/dist/ble.d.ts +38 -4
  10. package/dist/ble.d.ts.map +1 -1
  11. package/dist/ble.js +409 -53
  12. package/dist/ble.js.map +1 -1
  13. package/dist/devices/base.d.ts +83 -5
  14. package/dist/devices/base.d.ts.map +1 -1
  15. package/dist/devices/base.js +371 -34
  16. package/dist/devices/base.js.map +1 -1
  17. package/dist/devices/device-override-state-during-connection.d.ts +27 -0
  18. package/dist/devices/device-override-state-during-connection.d.ts.map +1 -0
  19. package/dist/devices/device-override-state-during-connection.js +45 -0
  20. package/dist/devices/device-override-state-during-connection.js.map +1 -0
  21. package/dist/devices/index.d.ts +29 -0
  22. package/dist/devices/index.d.ts.map +1 -1
  23. package/dist/devices/index.js +29 -0
  24. package/dist/devices/index.js.map +1 -1
  25. package/dist/devices/sequence-device.d.ts +36 -0
  26. package/dist/devices/sequence-device.d.ts.map +1 -0
  27. package/dist/devices/sequence-device.js +75 -0
  28. package/dist/devices/sequence-device.js.map +1 -0
  29. package/dist/devices/wo-air-purifier.d.ts +2 -2
  30. package/dist/devices/wo-air-purifier.d.ts.map +1 -1
  31. package/dist/devices/wo-air-purifier.js +2 -2
  32. package/dist/devices/wo-air-purifier.js.map +1 -1
  33. package/dist/devices/wo-art-frame.d.ts +8 -0
  34. package/dist/devices/wo-art-frame.d.ts.map +1 -0
  35. package/dist/devices/wo-art-frame.js +12 -0
  36. package/dist/devices/wo-art-frame.js.map +1 -0
  37. package/dist/devices/wo-bulb.d.ts +10 -0
  38. package/dist/devices/wo-bulb.d.ts.map +1 -1
  39. package/dist/devices/wo-bulb.js +69 -0
  40. package/dist/devices/wo-bulb.js.map +1 -1
  41. package/dist/devices/wo-circulator-fan.d.ts +8 -0
  42. package/dist/devices/wo-circulator-fan.d.ts.map +1 -0
  43. package/dist/devices/wo-circulator-fan.js +12 -0
  44. package/dist/devices/wo-circulator-fan.js.map +1 -0
  45. package/dist/devices/wo-climate-panel.d.ts +8 -0
  46. package/dist/devices/wo-climate-panel.d.ts.map +1 -0
  47. package/dist/devices/wo-climate-panel.js +12 -0
  48. package/dist/devices/wo-climate-panel.js.map +1 -0
  49. package/dist/devices/wo-curtain.d.ts +3 -3
  50. package/dist/devices/wo-curtain.d.ts.map +1 -1
  51. package/dist/devices/wo-curtain.js +12 -9
  52. package/dist/devices/wo-curtain.js.map +1 -1
  53. package/dist/devices/wo-floor-lamp.d.ts +8 -0
  54. package/dist/devices/wo-floor-lamp.d.ts.map +1 -0
  55. package/dist/devices/wo-floor-lamp.js +12 -0
  56. package/dist/devices/wo-floor-lamp.js.map +1 -0
  57. package/dist/devices/wo-garage-door-opener.d.ts +8 -0
  58. package/dist/devices/wo-garage-door-opener.d.ts.map +1 -0
  59. package/dist/devices/wo-garage-door-opener.js +12 -0
  60. package/dist/devices/wo-garage-door-opener.js.map +1 -0
  61. package/dist/devices/wo-hand.d.ts +53 -2
  62. package/dist/devices/wo-hand.d.ts.map +1 -1
  63. package/dist/devices/wo-hand.js +121 -3
  64. package/dist/devices/wo-hand.js.map +1 -1
  65. package/dist/devices/wo-hubmini-matter.d.ts +8 -0
  66. package/dist/devices/wo-hubmini-matter.d.ts.map +1 -0
  67. package/dist/devices/wo-hubmini-matter.js +12 -0
  68. package/dist/devices/wo-hubmini-matter.js.map +1 -0
  69. package/dist/devices/wo-humi2.d.ts +12 -0
  70. package/dist/devices/wo-humi2.d.ts.map +1 -1
  71. package/dist/devices/wo-humi2.js +18 -0
  72. package/dist/devices/wo-humi2.js.map +1 -1
  73. package/dist/devices/wo-keypad-vision-pro.d.ts +18 -0
  74. package/dist/devices/wo-keypad-vision-pro.d.ts.map +1 -0
  75. package/dist/devices/wo-keypad-vision-pro.js +15 -0
  76. package/dist/devices/wo-keypad-vision-pro.js.map +1 -0
  77. package/dist/devices/wo-keypad-vision.d.ts +8 -0
  78. package/dist/devices/wo-keypad-vision.d.ts.map +1 -0
  79. package/dist/devices/wo-keypad-vision.js +12 -0
  80. package/dist/devices/wo-keypad-vision.js.map +1 -0
  81. package/dist/devices/wo-lock-lite.d.ts +7 -0
  82. package/dist/devices/wo-lock-lite.d.ts.map +1 -0
  83. package/dist/devices/wo-lock-lite.js +11 -0
  84. package/dist/devices/wo-lock-lite.js.map +1 -0
  85. package/dist/devices/wo-lock-pro-wifi.d.ts +7 -0
  86. package/dist/devices/wo-lock-pro-wifi.d.ts.map +1 -0
  87. package/dist/devices/wo-lock-pro-wifi.js +11 -0
  88. package/dist/devices/wo-lock-pro-wifi.js.map +1 -0
  89. package/dist/devices/wo-lock-pro.d.ts +11 -2
  90. package/dist/devices/wo-lock-pro.d.ts.map +1 -1
  91. package/dist/devices/wo-lock-pro.js +65 -3
  92. package/dist/devices/wo-lock-pro.js.map +1 -1
  93. package/dist/devices/wo-lock-vision-pro.d.ts +7 -0
  94. package/dist/devices/wo-lock-vision-pro.d.ts.map +1 -0
  95. package/dist/devices/wo-lock-vision-pro.js +11 -0
  96. package/dist/devices/wo-lock-vision-pro.js.map +1 -0
  97. package/dist/devices/wo-lock-vision.d.ts +7 -0
  98. package/dist/devices/wo-lock-vision.d.ts.map +1 -0
  99. package/dist/devices/wo-lock-vision.js +11 -0
  100. package/dist/devices/wo-lock-vision.js.map +1 -0
  101. package/dist/devices/wo-lock.d.ts +7 -2
  102. package/dist/devices/wo-lock.d.ts.map +1 -1
  103. package/dist/devices/wo-lock.js +58 -3
  104. package/dist/devices/wo-lock.js.map +1 -1
  105. package/dist/devices/wo-plug-mini-us.d.ts +2 -2
  106. package/dist/devices/wo-plug-mini-us.d.ts.map +1 -1
  107. package/dist/devices/wo-plug-mini-us.js +2 -2
  108. package/dist/devices/wo-plug-mini-us.js.map +1 -1
  109. package/dist/devices/wo-relay-switch-1.d.ts +4 -2
  110. package/dist/devices/wo-relay-switch-1.d.ts.map +1 -1
  111. package/dist/devices/wo-relay-switch-1.js +36 -4
  112. package/dist/devices/wo-relay-switch-1.js.map +1 -1
  113. package/dist/devices/wo-relay-switch-2pm.d.ts +21 -0
  114. package/dist/devices/wo-relay-switch-2pm.d.ts.map +1 -0
  115. package/dist/devices/wo-relay-switch-2pm.js +39 -0
  116. package/dist/devices/wo-relay-switch-2pm.js.map +1 -0
  117. package/dist/devices/wo-rgbic-bulb.d.ts +29 -0
  118. package/dist/devices/wo-rgbic-bulb.d.ts.map +1 -0
  119. package/dist/devices/wo-rgbic-bulb.js +84 -0
  120. package/dist/devices/wo-rgbic-bulb.js.map +1 -0
  121. package/dist/devices/wo-rgbicww-floor-lamp.d.ts +8 -0
  122. package/dist/devices/wo-rgbicww-floor-lamp.d.ts.map +1 -0
  123. package/dist/devices/wo-rgbicww-floor-lamp.js +12 -0
  124. package/dist/devices/wo-rgbicww-floor-lamp.js.map +1 -0
  125. package/dist/devices/wo-rgbicww-strip-light.d.ts +8 -0
  126. package/dist/devices/wo-rgbicww-strip-light.d.ts.map +1 -0
  127. package/dist/devices/wo-rgbicww-strip-light.js +12 -0
  128. package/dist/devices/wo-rgbicww-strip-light.js.map +1 -0
  129. package/dist/devices/wo-roller-shade.d.ts +8 -0
  130. package/dist/devices/wo-roller-shade.d.ts.map +1 -0
  131. package/dist/devices/wo-roller-shade.js +12 -0
  132. package/dist/devices/wo-roller-shade.js.map +1 -0
  133. package/dist/devices/wo-smart-thermostat-radiator.d.ts +8 -0
  134. package/dist/devices/wo-smart-thermostat-radiator.d.ts.map +1 -0
  135. package/dist/devices/wo-smart-thermostat-radiator.js +12 -0
  136. package/dist/devices/wo-smart-thermostat-radiator.js.map +1 -0
  137. package/dist/devices/wo-strip-light-3.d.ts +8 -0
  138. package/dist/devices/wo-strip-light-3.d.ts.map +1 -0
  139. package/dist/devices/wo-strip-light-3.js +12 -0
  140. package/dist/devices/wo-strip-light-3.js.map +1 -0
  141. package/dist/devices/wo-vacuum-k10-plus.d.ts +7 -0
  142. package/dist/devices/wo-vacuum-k10-plus.d.ts.map +1 -0
  143. package/dist/devices/wo-vacuum-k10-plus.js +11 -0
  144. package/dist/devices/wo-vacuum-k10-plus.js.map +1 -0
  145. package/dist/devices/wo-vacuum-k10-pro-combo.d.ts +7 -0
  146. package/dist/devices/wo-vacuum-k10-pro-combo.d.ts.map +1 -0
  147. package/dist/devices/wo-vacuum-k10-pro-combo.js +11 -0
  148. package/dist/devices/wo-vacuum-k10-pro-combo.js.map +1 -0
  149. package/dist/devices/wo-vacuum-k10-pro.d.ts +7 -0
  150. package/dist/devices/wo-vacuum-k10-pro.d.ts.map +1 -0
  151. package/dist/devices/wo-vacuum-k10-pro.js +11 -0
  152. package/dist/devices/wo-vacuum-k10-pro.js.map +1 -0
  153. package/dist/devices/wo-vacuum-k11-plus.d.ts +7 -0
  154. package/dist/devices/wo-vacuum-k11-plus.d.ts.map +1 -0
  155. package/dist/devices/wo-vacuum-k11-plus.js +11 -0
  156. package/dist/devices/wo-vacuum-k11-plus.js.map +1 -0
  157. package/dist/devices/wo-vacuum-k20.d.ts +7 -0
  158. package/dist/devices/wo-vacuum-k20.d.ts.map +1 -0
  159. package/dist/devices/wo-vacuum-k20.js +11 -0
  160. package/dist/devices/wo-vacuum-k20.js.map +1 -0
  161. package/dist/devices/wo-vacuum-s10.d.ts +7 -0
  162. package/dist/devices/wo-vacuum-s10.d.ts.map +1 -0
  163. package/dist/devices/wo-vacuum-s10.js +11 -0
  164. package/dist/devices/wo-vacuum-s10.js.map +1 -0
  165. package/dist/devices/wo-vacuum-s20.d.ts +7 -0
  166. package/dist/devices/wo-vacuum-s20.d.ts.map +1 -0
  167. package/dist/devices/wo-vacuum-s20.js +11 -0
  168. package/dist/devices/wo-vacuum-s20.js.map +1 -0
  169. package/dist/devices/wo-vacuum.d.ts +44 -0
  170. package/dist/devices/wo-vacuum.d.ts.map +1 -0
  171. package/dist/devices/wo-vacuum.js +117 -0
  172. package/dist/devices/wo-vacuum.js.map +1 -0
  173. package/dist/index.d.ts +4 -2
  174. package/dist/index.d.ts.map +1 -1
  175. package/dist/index.js +3 -1
  176. package/dist/index.js.map +1 -1
  177. package/dist/settings.d.ts +27 -0
  178. package/dist/settings.d.ts.map +1 -1
  179. package/dist/settings.js +76 -6
  180. package/dist/settings.js.map +1 -1
  181. package/dist/switchbot.d.ts.map +1 -1
  182. package/dist/switchbot.js +86 -9
  183. package/dist/switchbot.js.map +1 -1
  184. package/dist/types/ble.d.ts +20 -1
  185. package/dist/types/ble.d.ts.map +1 -1
  186. package/dist/types/ble.js.map +1 -1
  187. package/dist/types/device.d.ts +49 -3
  188. package/dist/types/device.d.ts.map +1 -1
  189. package/dist/types/index.d.ts +22 -0
  190. package/dist/types/index.d.ts.map +1 -1
  191. package/dist/types/index.js.map +1 -1
  192. package/dist/utils/bot-ble.d.ts +36 -0
  193. package/dist/utils/bot-ble.d.ts.map +1 -0
  194. package/dist/utils/bot-ble.js +109 -0
  195. package/dist/utils/bot-ble.js.map +1 -0
  196. package/dist/utils/circuit-breaker.d.ts +98 -0
  197. package/dist/utils/circuit-breaker.d.ts.map +1 -0
  198. package/dist/utils/circuit-breaker.js +187 -0
  199. package/dist/utils/circuit-breaker.js.map +1 -0
  200. package/dist/utils/connection-tracker.d.ts +66 -0
  201. package/dist/utils/connection-tracker.d.ts.map +1 -0
  202. package/dist/utils/connection-tracker.js +184 -0
  203. package/dist/utils/connection-tracker.js.map +1 -0
  204. package/dist/utils/fallback-handler.d.ts +68 -0
  205. package/dist/utils/fallback-handler.d.ts.map +1 -0
  206. package/dist/utils/fallback-handler.js +131 -0
  207. package/dist/utils/fallback-handler.js.map +1 -0
  208. package/dist/utils/index.d.ts +10 -0
  209. package/dist/utils/index.d.ts.map +1 -1
  210. package/dist/utils/index.js +41 -4
  211. package/dist/utils/index.js.map +1 -1
  212. package/dist/utils/retry.d.ts +55 -0
  213. package/dist/utils/retry.d.ts.map +1 -0
  214. package/dist/utils/retry.js +95 -0
  215. package/dist/utils/retry.js.map +1 -0
  216. package/docs/assets/hierarchy.js +1 -1
  217. package/docs/assets/navigation.js +1 -1
  218. package/docs/assets/search.js +1 -1
  219. package/docs/classes/APIError.html +2 -2
  220. package/docs/classes/APINotAvailableError.html +2 -2
  221. package/docs/classes/BLEConnection.html +16 -10
  222. package/docs/classes/BLENotAvailableError.html +2 -2
  223. package/docs/classes/BLEScanner.html +11 -9
  224. package/docs/classes/CommandFailedError.html +2 -2
  225. package/docs/classes/ConnectionTimeoutError.html +2 -2
  226. package/docs/classes/DeviceManager.html +13 -13
  227. package/docs/classes/DeviceNotFoundError.html +2 -2
  228. package/docs/classes/DeviceOverrideStateDuringConnection.html +56 -0
  229. package/docs/classes/DiscoveryError.html +2 -2
  230. package/docs/classes/OpenAPIClient.html +24 -24
  231. package/docs/classes/SequenceDevice.html +58 -0
  232. package/docs/classes/SwitchBot.html +11 -11
  233. package/docs/classes/SwitchBotDevice.html +43 -15
  234. package/docs/classes/SwitchBotError.html +2 -2
  235. package/docs/classes/ValidationError.html +2 -2
  236. package/docs/classes/WoAirPurifier.html +48 -18
  237. package/docs/classes/WoAirPurifierTable.html +48 -18
  238. package/docs/classes/WoArtFrame.html +71 -0
  239. package/docs/classes/WoBlindTilt.html +48 -20
  240. package/docs/classes/WoBulb.html +52 -19
  241. package/docs/classes/WoCeilingLight.html +52 -19
  242. package/docs/classes/WoCirculatorFan.html +66 -0
  243. package/docs/classes/WoClimatePanel.html +66 -0
  244. package/docs/classes/WoContact.html +42 -14
  245. package/docs/classes/WoCurtain.html +46 -18
  246. package/docs/classes/WoFloorLamp.html +71 -0
  247. package/docs/classes/WoGarageDoorOpener.html +64 -0
  248. package/docs/classes/WoHand.html +63 -19
  249. package/docs/classes/WoHub2.html +42 -14
  250. package/docs/classes/WoHub3.html +42 -14
  251. package/docs/classes/WoHubMiniMatter.html +56 -0
  252. package/docs/classes/WoHumi.html +46 -18
  253. package/docs/classes/WoHumi2.html +52 -18
  254. package/docs/classes/WoIOSensorTH.html +42 -14
  255. package/docs/classes/WoKeypad.html +42 -14
  256. package/docs/classes/WoKeypadVision.html +56 -0
  257. package/docs/classes/WoKeypadVisionPro.html +56 -0
  258. package/docs/classes/WoLeak.html +42 -14
  259. package/docs/classes/WoPlugMiniJP.html +45 -17
  260. package/docs/classes/WoPlugMiniUS.html +45 -17
  261. package/docs/classes/WoPresence.html +42 -14
  262. package/docs/classes/WoRGBICBulb.html +82 -0
  263. package/docs/classes/WoRGBICWWFloorLamp.html +82 -0
  264. package/docs/classes/WoRGBICWWStripLight.html +82 -0
  265. package/docs/classes/WoRelaySwitch1.html +47 -17
  266. package/docs/classes/WoRelaySwitch1PM.html +47 -17
  267. package/docs/classes/WoRelaySwitch2PM.html +68 -0
  268. package/docs/classes/WoRemote.html +42 -14
  269. package/docs/classes/WoRollerShade.html +64 -0
  270. package/docs/classes/WoSensorTH.html +42 -14
  271. package/docs/classes/WoSensorTHPlus.html +42 -14
  272. package/docs/classes/WoSensorTHPro.html +42 -14
  273. package/docs/classes/WoSensorTHProCO2.html +42 -14
  274. package/docs/classes/WoSmartLock.html +49 -16
  275. package/docs/classes/WoSmartLockLite.html +64 -0
  276. package/docs/classes/WoSmartLockPro.html +52 -17
  277. package/docs/classes/WoSmartLockProWiFi.html +68 -0
  278. package/docs/classes/WoSmartLockVision.html +64 -0
  279. package/docs/classes/WoSmartLockVisionPro.html +68 -0
  280. package/docs/classes/WoSmartThermostatRadiator.html +66 -0
  281. package/docs/classes/WoStrip.html +52 -19
  282. package/docs/classes/WoStripLight3.html +71 -0
  283. package/docs/classes/WoVacuum.html +71 -0
  284. package/docs/classes/WoVacuumK10Plus.html +71 -0
  285. package/docs/classes/WoVacuumK10Pro.html +71 -0
  286. package/docs/classes/WoVacuumK10ProCombo.html +71 -0
  287. package/docs/classes/WoVacuumK11Plus.html +71 -0
  288. package/docs/classes/WoVacuumK20.html +71 -0
  289. package/docs/classes/WoVacuumS10.html +71 -0
  290. package/docs/classes/WoVacuumS20.html +71 -0
  291. package/docs/enums/LogLevel.html +2 -2
  292. package/docs/enums/SwitchBotBLEModel.html +2 -2
  293. package/docs/enums/SwitchBotBLEModelName.html +2 -2
  294. package/docs/functions/updateBaseURL.html +1 -1
  295. package/docs/hierarchy.html +1 -1
  296. package/docs/index.html +2 -2
  297. package/docs/interfaces/APICommandRequest.html +2 -2
  298. package/docs/interfaces/APICommandResponse.html +2 -2
  299. package/docs/interfaces/APIDevice.html +2 -2
  300. package/docs/interfaces/APIDeviceStatus.html +2 -2
  301. package/docs/interfaces/APIErrorResponse.html +2 -2
  302. package/docs/interfaces/APIResponse.html +2 -2
  303. package/docs/interfaces/AirPurifierCommands.html +2 -2
  304. package/docs/interfaces/AirPurifierServiceData.html +20 -5
  305. package/docs/interfaces/AirPurifierStatus.html +7 -7
  306. package/docs/interfaces/BLEAdvertisement.html +3 -2
  307. package/docs/interfaces/BLEScanOptions.html +5 -5
  308. package/docs/interfaces/BLEServiceData.html +22 -5
  309. package/docs/interfaces/BlindTiltCommands.html +2 -2
  310. package/docs/interfaces/BlindTiltServiceData.html +21 -5
  311. package/docs/interfaces/BlindTiltStatus.html +6 -6
  312. package/docs/interfaces/BotCommands.html +6 -2
  313. package/docs/interfaces/BotServiceData.html +20 -5
  314. package/docs/interfaces/BotStatus.html +6 -6
  315. package/docs/interfaces/BulbCommands.html +4 -2
  316. package/docs/interfaces/BulbServiceData.html +21 -5
  317. package/docs/interfaces/BulbStatus.html +6 -6
  318. package/docs/interfaces/CeilingLightCommands.html +4 -2
  319. package/docs/interfaces/CeilingLightServiceData.html +21 -5
  320. package/docs/interfaces/CeilingLightStatus.html +6 -6
  321. package/docs/interfaces/CommandResult.html +6 -6
  322. package/docs/interfaces/ContactServiceData.html +22 -5
  323. package/docs/interfaces/ContactStatus.html +6 -6
  324. package/docs/interfaces/CurtainCommands.html +2 -2
  325. package/docs/interfaces/CurtainServiceData.html +22 -5
  326. package/docs/interfaces/CurtainStatus.html +6 -6
  327. package/docs/interfaces/DeviceInfo.html +23 -13
  328. package/docs/interfaces/DeviceListResponse.html +2 -2
  329. package/docs/interfaces/DeviceStatus.html +6 -6
  330. package/docs/interfaces/DiscoveryOptions.html +7 -7
  331. package/docs/interfaces/HubServiceData.html +22 -5
  332. package/docs/interfaces/HubStatus.html +6 -6
  333. package/docs/interfaces/HumidifierCommands.html +2 -2
  334. package/docs/interfaces/HumidifierServiceData.html +23 -6
  335. package/docs/interfaces/HumidifierStatus.html +6 -6
  336. package/docs/interfaces/KeypadStatus.html +6 -6
  337. package/docs/interfaces/LeakServiceData.html +22 -5
  338. package/docs/interfaces/LeakStatus.html +6 -6
  339. package/docs/interfaces/LockCommands.html +6 -2
  340. package/docs/interfaces/LockServiceData.html +20 -6
  341. package/docs/interfaces/LockStatus.html +6 -6
  342. package/docs/interfaces/MeterServiceData.html +22 -5
  343. package/docs/interfaces/MeterStatus.html +6 -6
  344. package/docs/interfaces/MotionServiceData.html +22 -5
  345. package/docs/interfaces/MotionStatus.html +6 -6
  346. package/docs/interfaces/PlugCommands.html +2 -2
  347. package/docs/interfaces/PlugServiceData.html +21 -5
  348. package/docs/interfaces/PlugStatus.html +6 -6
  349. package/docs/interfaces/PresenceServiceData.html +22 -5
  350. package/docs/interfaces/PresenceStatus.html +6 -6
  351. package/docs/interfaces/RelaySwitchCommands.html +2 -2
  352. package/docs/interfaces/RelaySwitchServiceData.html +21 -5
  353. package/docs/interfaces/RelaySwitchStatus.html +6 -6
  354. package/docs/interfaces/RemoteStatus.html +6 -6
  355. package/docs/interfaces/SceneListResponse.html +2 -2
  356. package/docs/interfaces/StripCommands.html +4 -2
  357. package/docs/interfaces/StripServiceData.html +21 -5
  358. package/docs/interfaces/StripStatus.html +6 -6
  359. package/docs/interfaces/SwitchBotConfig.html +21 -9
  360. package/docs/interfaces/VacuumCommands.html +8 -0
  361. package/docs/interfaces/VacuumStatus.html +16 -0
  362. package/docs/interfaces/WebhookConfig.html +2 -2
  363. package/docs/interfaces/WebhookDetails.html +2 -2
  364. package/docs/interfaces/WebhookQueryResponse.html +2 -2
  365. package/docs/interfaces/WebhookSetupResponse.html +2 -2
  366. package/docs/media/BLE.md +117 -4
  367. package/docs/modules.html +1 -1
  368. package/docs/types/ConnectionType.html +1 -1
  369. package/docs/types/PhysicalDeviceType.html +1 -1
  370. package/docs/types/VirtualDeviceType.html +1 -1
  371. package/docs/variables/urls.html +1 -1
  372. package/package.json +11 -7
  373. package/tmp-switchbot-scan.mjs +79 -0
  374. package/todo/PYSWITCHBOT_COMPARISON.md +484 -0
  375. package/todo/README.md +68 -0
  376. package/todo/completed.md +309 -0
  377. package/todo/todo.md +302 -0
  378. package/tsconfig.build.json +17 -0
  379. package/PRODUCTION_READY.md +0 -135
@@ -0,0 +1,309 @@
1
+ # Completed Tasks
2
+
3
+ Track completed implementation tasks from the pySwitchBot comparison roadmap.
4
+
5
+ Last Updated: March 7, 2026
6
+
7
+ ---
8
+
9
+ ## Phase 3: New Devices - Other Devices Block (March 7, 2026)
10
+
11
+ ### Task 17.6: HubMini Matter ✅
12
+ **Implementation Details:**
13
+ - Created `WoHubMiniMatter` class extending `WoHub2` in `src/devices/wo-hubmini-matter.ts`
14
+ - Inherits all hub functionality: `getStatus()` returning sensor data (temperature, humidity, lightLevel)
15
+ - Wired through 3-layer export chain (device → devices/index.ts → src/index.ts)
16
+ - Added to runtime registry: `DEVICE_CLASSES['WoHubMiniMatter']` in `src/switchbot.ts`
17
+ - Added device-type mappings in `src/settings.ts`: "HubMini Matter", "SwitchBot HubMini Matter"
18
+ - Created `test/hubmini-matter.test.ts` with 3 tests validating device-type mappings and method inheritance from WoHub2
19
+ - Full validation passed: build ✅ tests ✅ (233 passing) lint ✅ type-check ✅
20
+
21
+ ### Task 17.5: Hub3 Enhancement ✅
22
+ **Implementation Details:**
23
+ - Enhanced existing `WoHub3` class (extends `WoHub2` in `src/devices/wo-hub3.ts`)
24
+ - Added device-type alias in `src/settings.ts`: "SwitchBot Hub 3" (in addition to existing "Hub 3")
25
+ - Created `test/hub3.test.ts` with 3 tests validating device-type mappings and method inheritance from WoHub2
26
+ - Verified inheritance: `getStatus()` method returns hub sensor data (temperature, humidity, lightLevel)
27
+ - Full validation passed: build ✅ tests ✅ (230 passing) lint ✅ type-check ✅
28
+
29
+ ### Task 17.4: Keypad Vision Pro ✅
30
+ **Implementation Details:**
31
+ - Created `WoKeypadVisionPro` class extending `WoKeypad` in `src/devices/wo-keypad-vision-pro.ts`
32
+ - Inherits all keypad functionality: `getStatus()` methods
33
+ - Wired through 3-layer export chain (device → devices/index.ts → src/index.ts)
34
+ - Added to runtime registry: `DEVICE_CLASSES['WoKeypadVisionPro']` in `src/switchbot.ts`
35
+ - Added device-type mappings in `src/settings.ts`: "Keypad Vision Pro", "SwitchBot Keypad Vision Pro"
36
+ - Created `test/keypad-vision-pro.test.ts` with 3 tests validating device-type mapping and method inheritance
37
+ - Full validation passed: build ✅ tests ✅ (227 passing) lint ✅ type-check ✅
38
+
39
+ ### Task 17.3: Keypad Vision ✅
40
+ **Implementation Details:**
41
+ - Created `WoKeypadVision` class extending `WoKeypad` in `src/devices/wo-keypad-vision.ts`
42
+ - Inherits all keypad functionality: `getStatus()` methods
43
+ - Wired through 3-layer export chain (device → devices/index.ts → src/index.ts)
44
+ - Added to runtime registry: `DEVICE_CLASSES['WoKeypadVision']` in `src/switchbot.ts`
45
+ - Added device-type mappings in `src/settings.ts`: "Keypad Vision", "SwitchBot Keypad Vision"
46
+ - Created `test/keypad-vision.test.ts` with 3 tests validating device-type mapping and method inheritance
47
+ - Full validation passed: build ✅ tests ✅ (224 passing) lint ✅ type-check ✅
48
+
49
+ ---
50
+
51
+ ## Phase 0: Foundation & Preparation ✅
52
+
53
+ ### BLE Infrastructure Hardening (Completed March 6, 2026)
54
+ - [x] Add enumerable device properties for Homebridge compatibility
55
+ - [x] Implement ID-based BLE lookups for macOS (empty MAC address support)
56
+ - [x] Add manufacturer data MAC extraction fallback
57
+ - [x] Broaden discovery filters for legacy UUIDs (000d)
58
+ - [x] Add peripheral validation (connectable flag, RSSI bounds)
59
+ - [x] Implement BLE event listener cleanup
60
+ - [x] Add connection error cleanup (characteristics discovery failure)
61
+ - [x] Create BLE lifecycle regression tests
62
+ - [x] Fix resource leaks (event listeners, connection maps)
63
+
64
+ ### Testing & Validation (Completed March 6-7, 2026)
65
+ - [x] 124 unit tests passing
66
+ - [x] BLE scanner lifecycle tests
67
+ - [x] BLE connection cleanup tests
68
+ - [x] macOS compatibility validation (45 real devices)
69
+
70
+ ---
71
+
72
+ ## Phase 1: Core Parity Sprint ✅
73
+
74
+ ### Completed March 7, 2026
75
+ - [x] Advertisement status parsing and model cache support
76
+ - Added richer advertisement parsing for Bot, Curtain/Curtain3, Lock/Lock Pro, and Relay Switch models
77
+ - Added per-discovery model cache in `BLEScanner`
78
+ - Stored parsed BLE service data on device info for status fallback
79
+
80
+ - [x] Curtain speed control
81
+ - Added optional speed to `open`, `close`, and `setPosition` commands
82
+ - Updated BLE payload and OpenAPI `setPosition` parameter construction
83
+
84
+ - [x] GCM/CTR BLE encryption plumbing
85
+ - Added encryption mode (`auto`/`ctr`/`gcm`) support in `BLEConnection`
86
+ - Added IV length validation, auto mode resolution, and GCM IV increment behavior
87
+
88
+ - [x] BLE command result and password response validation
89
+ - Added command response checks for ack bytes (`0x01`, `0x05`, `0x06`)
90
+ - Added password-required (`0x07`) and password-incorrect (`0x09`) detection
91
+
92
+ - [x] Persistent BLE connections + operation locking
93
+ - Added per-device operation lock queue in `BLEConnection`
94
+ - Added configurable persistent connection timer with auto-disconnect
95
+ - Added device-level BLE command serialization in base device class
96
+
97
+ ---
98
+
99
+ ## Phase 2: Command Enhancement (Wave 1) ✅
100
+
101
+ ### Completed March 7, 2026
102
+ - [x] Bot mode configuration
103
+ - Implemented `setMode('press'|'switch')`, `setLongPress(duration)`, `handUp()`, and `handDown()` on `WoHand`
104
+
105
+ - [x] Lock advanced features
106
+ - Implemented `unlockWithoutUnlatch()` on `WoSmartLockPro`
107
+ - Added smart pre-checks to skip lock/unlock when already in target state
108
+ - Added `getLockInfo()` helper on lock devices
109
+ - Added BLE notification subscription hooks for lock updates
110
+
111
+ - [x] Light effect presets
112
+ - Added 20 preset effects with `setEffect(effectName, speed)` on `WoBulb`/`WoStrip`
113
+
114
+ - [x] Relay power monitoring
115
+ - Added relay basic-info parsing for voltage/current/energy from BLE response payload
116
+ - Integrated parsed metrics into relay BLE status response
117
+
118
+ - [x] Phase 2 regression coverage
119
+ - Added `test/phase2-features.test.ts` covering Bot mode config, lock smart detection, light effects, and relay metrics parsing
120
+
121
+ ---
122
+
123
+ ## Phase 2: Command Enhancement (Wave 2) ✅
124
+
125
+ ### Completed March 7, 2026
126
+ - [x] Relay 2PM channel-specific control (Task 5.3)
127
+ - Created `WoRelaySwitch2PM` class extending `WoRelaySwitch1`
128
+ - Implemented `setChannel1(state: boolean)` and `setChannel2(state: boolean)` methods
129
+ - Added channel-specific command constants (CHANNEL1_ON/OFF, CHANNEL2_ON/OFF) to DEVICE_COMMANDS.RELAY
130
+
131
+ - [x] Bulb color temperature with min/max bounds (Task 6.3)
132
+ - Added `setColorTemp(minTemp, maxTemp, temp)` method to `WoBulb` class
133
+ - Command format: `0x57 0x0F 0x47 0x01 0x17 BRIGHTNESS MIN_KEL MAX_KEL TEMP`
134
+ - Validates and clamps temperatures, ensures current temp within min/max bounds
135
+ - Auto-corrects reversed min/max values
136
+
137
+ - [x] RGBIC bulb segmented control (Task 6.2)
138
+ - Created `WoRGBICBulb` class extending `WoBulb`
139
+ - Implemented `setSegmentColor(segmentId, r, g, b)` for individual LED segment color control
140
+ - Implemented `setSegmentEffect(segmentId, effectName, speed)` for segment-specific effects
141
+ - Added 25 RGBIC effects including segment_cycle, segment_wave, segment_chase, segment_strobe, segment_twinkle
142
+ - Inherits all standard bulb features from WoBulb (standard effects, color temperature bounds)
143
+
144
+ - [x] Phase 2 Wave 2 regression coverage
145
+ - Added `test/phase2-remaining.test.ts` with 21 tests covering Relay 2PM channels, color temperature bounds, and RGBIC segmented control
146
+
147
+ ---
148
+
149
+ ## Phase 2: Advanced Features ✅
150
+
151
+ ### Completed March 7, 2026
152
+ - [x] Sequence device pattern (Task 21.1)
153
+ - Added `SequenceDevice` base class
154
+ - Tracks advertisement `sequenceNumber` changes and emits `sequence-changed`
155
+ - Auto-triggers `update()` on sequence changes with in-flight suppression
156
+ - Applied to lock, relay switch, and air purifier device families
157
+ - Added regression coverage in `test/sequence-device.test.ts`
158
+
159
+ - [x] Override state during connection pattern (Task 21.2)
160
+ - Added `DeviceOverrideStateDuringConnection` base class
161
+ - Ignores advertisement state (`bleServiceData`, battery, RSSI) while BLE connection is active
162
+ - Prevents stale advertisement fallback state during live connections
163
+ - Applied to bot and plug device families
164
+ - Added regression coverage in `test/device-override-state-during-connection.test.ts`
165
+
166
+ ---
167
+
168
+ ## Phase 3: New Device Types (Vacuum Variants) ✅
169
+
170
+ ### Completed March 7, 2026
171
+ - [x] K10+ / K10+ Pro / K10+ Pro Combo vacuum variants (Tasks 12.1-12.3)
172
+ - Added `WoVacuumK10Plus`, `WoVacuumK10Pro`, and `WoVacuumK10ProCombo` classes
173
+ - Reused shared `WoVacuum` command/status behavior to avoid duplication
174
+ - Wired `DEVICE_CLASS_MAP` routing for K10 family API/BLE names
175
+
176
+ - [x] K11+ / K20 / S10 / S20 vacuum variants (Tasks 12.4-12.7)
177
+ - Added `WoVacuumK11Plus`, `WoVacuumK20`, `WoVacuumS10`, and `WoVacuumS20` classes
178
+ - Updated `SwitchBot` runtime device registry and package exports
179
+ - Added regression coverage in `test/vacuum-variants.test.ts` for class mapping
180
+
181
+ - [x] Lock Lite / Lock Vision variants (Tasks 13.1-13.2)
182
+ - Added `WoSmartLockLite` and `WoSmartLockVision` classes extending `WoSmartLock`
183
+ - Both variants use base lock functionality without unlatch support
184
+ - Wired `DEVICE_CLASS_MAP` routing for lock variant API/BLE names
185
+
186
+ - [x] Lock Vision Pro / Lock Pro WiFi variants (Tasks 13.3-13.4)
187
+ - Added `WoSmartLockVisionPro` and `WoSmartLockProWiFi` classes extending `WoSmartLockPro`
188
+ - Both variants inherit pro lock features including unlatch support
189
+ - Updated `SwitchBot` runtime device registry and package exports
190
+ - Added regression coverage in `test/lock-variants.test.ts` for class mapping and method inheritance
191
+
192
+ ---
193
+
194
+ ## Phase 3: New Device Types (Relay Variants) ✅
195
+
196
+ ### Completed March 7, 2026
197
+ - [x] Relay Switch 2PM wiring completion (Task 14.1)
198
+ - WoRelaySwitch2PM class already existed from Phase 2
199
+ - Completed wiring through src/index.ts exports
200
+ - Added to src/switchbot.ts DEVICE_CLASSES registry
201
+ - Added 'Relay Switch 2PM' mapping to DEVICE_CLASS_MAP in src/settings.ts
202
+
203
+ - [x] Garage Door Opener relay variant (Task 14.2)
204
+ - Added WoGarageDoorOpener class extending WoRelaySwitch1
205
+ - Lightweight variant reuses relay switch control methods (turnOn/turnOff/toggle)
206
+ - Wired through exports, registry, and DEVICE_CLASS_MAP
207
+ - Added regression coverage in test/relay-variants.test.ts (4 tests)
208
+ - Tests verify: 2PM class mapping, Garage Door Opener mapping, channel methods on 2PM, relay methods on opener
209
+
210
+ ---
211
+
212
+ ## Phase 3: New Device Types (Climate Enhancements) ✅
213
+
214
+ ### Completed March 7, 2026
215
+ - [x] Evaporative Humidifier (WoHumi2) enhancement (Task 15.1)
216
+ - Enhanced WoHumi2 with convenience methods: setAuto(), setManual(), setLevel(level)
217
+ - Added evaporative humidifier API aliases in DEVICE_CLASS_MAP to map to WoHumi2
218
+ - Added regression coverage in test/humidifier2-enhancement.test.ts (4 tests)
219
+ - Tests verify WoHumi2 method delegation and evaporative humidifier device-type mapping
220
+
221
+ - [x] Circulator Fan (Battery/USB) variant (Task 15.2)
222
+ - Added WoCirculatorFan class extending WoAirPurifier
223
+ - Wired fan class through exports and SwitchBot runtime DEVICE_CLASSES registry
224
+ - Added device-type aliases in DEVICE_CLASS_MAP for Battery/USB fan names
225
+ - Added regression coverage in test/circulator-fan-variants.test.ts (4 tests)
226
+ - Tests verify model mapping and inherited control methods (turnOn/turnOff/setFanSpeed)
227
+
228
+ - [x] Smart Thermostat Radiator variant (Task 15.3)
229
+ - Added WoSmartThermostatRadiator class extending WoAirPurifier
230
+ - Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
231
+ - Added device-type aliases in DEVICE_CLASS_MAP for thermostat radiator names
232
+ - Added regression coverage in test/thermostat-radiator-variants.test.ts (4 tests)
233
+ - Tests verify model mapping and inherited climate control methods (turnOn/turnOff/setMode)
234
+
235
+ - [x] Climate Panel variant (Task 15.4)
236
+ - Added WoClimatePanel class extending WoAirPurifier
237
+ - Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
238
+ - Added climate panel aliases in DEVICE_CLASS_MAP
239
+ - Added regression coverage in test/climate-panel-variants.test.ts (3 tests)
240
+ - Tests verify model mapping and inherited climate control methods (turnOn/turnOff/setMode)
241
+
242
+ ## Phase 3: New Device Types (Lighting Variants) ⏳
243
+
244
+ ### Completed March 7, 2026
245
+ - [x] Strip Light 3 (Task 16.1)
246
+ - Added WoStripLight3 class extending WoBulb for color control
247
+ - Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
248
+ - Added device-type mappings: "Strip Light 3", "SwitchBot Strip Light 3"
249
+ - Added regression coverage in test/strip-light-3.test.ts (3 tests)
250
+ - Tests verify device-type mapping for both aliases and inherited color control methods
251
+
252
+ - [x] Floor Lamp (Task 16.2)
253
+ - Added WoFloorLamp class extending WoBulb for color control
254
+ - Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
255
+ - Added device-type mappings: "Floor Lamp", "SwitchBot Floor Lamp"
256
+ - Added regression coverage in test/floor-lamp.test.ts (3 tests)
257
+ - Tests verify device-type mapping for both aliases and inherited color control methods
258
+
259
+ - [x] RGBICWW Strip Light (Task 16.3)
260
+ - Added WoRGBICWWStripLight class extending WoRGBICBulb for segmented control
261
+ - Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
262
+ - Added device-type mappings: "RGBICWW Strip Light", "SwitchBot RGBICWW Strip Light"
263
+ - Added regression coverage in test/rgbicww-strip-light.test.ts (3 tests)
264
+ - Tests verify device-type mapping and inherited RGBIC methods (setSegmentColor, setSegmentEffect)
265
+ - Note: Also wired WoRGBICBulb through exports for completeness
266
+
267
+ - [x] RGBICWW Floor Lamp (Task 16.4)
268
+ - Added WoRGBICWWFloorLamp class extending WoRGBICBulb for segmented control
269
+ - Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
270
+ - Added device-type mappings: "RGBICWW Floor Lamp", "SwitchBot RGBICWW Floor Lamp"
271
+ - Added regression coverage in test/rgbicww-floor-lamp.test.ts (3 tests)
272
+ - Tests verify device-type mapping and inherited RGBIC methods (setSegmentColor, setSegmentEffect)
273
+
274
+ - [x] Art Frame (Task 16.5)
275
+ - Added WoArtFrame class extending WoBulb for color control
276
+ - Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
277
+ - Added device-type mappings: "Art Frame", "SwitchBot Art Frame"
278
+ - Added regression coverage in test/art-frame.test.ts (3 tests)
279
+ - Tests verify device-type mapping for both aliases and inherited color control methods
280
+ - **Lighting variants block (Tasks 16.1-16.5) complete!** ✅
281
+
282
+ ## Phase 3: New Device Types (Other Devices) ⏳
283
+
284
+ ### Completed March 7, 2026
285
+ - [x] Plug Mini EU verification (Task 17.1)
286
+ - Verified WoPlugMiniEU exists in runtime registry (aliased to WoPlugMiniUS)
287
+ - Verified device-type mapping: "Plug Mini (EU)" → WoPlugMiniEU
288
+ - Added regression coverage in test/plug-mini-eu.test.ts (2 tests)
289
+ - Tests verify EU variant maps to WoPlugMiniUS class and inherits plug control methods
290
+ - Note: WoPlugMiniEU shares implementation with WoPlugMiniUS (regional variant)
291
+
292
+ - [x] Roller Shade (Task 17.2)
293
+ - Added WoRollerShade class extending WoCurtain for motorized window covering control
294
+ - Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
295
+ - Added device-type mappings: "Roller Shade", "SwitchBot Roller Shade"
296
+ - Added regression coverage in test/roller-shade.test.ts (3 tests)
297
+ - Tests verify device-type mapping and inherited curtain control methods (open, close, pause, setPosition)
298
+
299
+ ---
300
+
301
+ ## Notes
302
+
303
+ When moving a task from todo.md to this file:
304
+ 1. Add the completion date
305
+ 2. Note any implementation details or deviations
306
+ 3. Link to relevant PRs or commits if applicable
307
+ 4. Update "Last Updated" timestamp
308
+
309
+ Format: `- [x] **Task X.Y**: Description (Completed: YYYY-MM-DD)`
package/todo/todo.md ADDED
@@ -0,0 +1,302 @@
1
+ # TODO: pySwitchBot Feature Parity Roadmap
2
+
3
+ Implementation tasks to achieve feature parity with pySwitchBot.
4
+
5
+ Last Updated: March 7, 2026
6
+ Source: [PYSWITCHBOT_COMPARISON.md](./PYSWITCHBOT_COMPARISON.md)
7
+
8
+ ---
9
+
10
+ ## 📅 Phase 2: Command Enhancement (Q2 2026)
11
+
12
+ ### 🤖 Bot (WoHand) Commands
13
+
14
+ ### 🔒 Lock Commands
15
+
16
+ ### 💡 Light (Bulb/Strip) Commands
17
+
18
+ ### ⚡ Relay Switch Commands
19
+
20
+ ### ✨ Advanced Features
21
+
22
+ - ✅ Phase 2 completed. See `todo/completed.md` for completed task details.
23
+
24
+ ---
25
+
26
+ ## 📅 Phase 3: New Devices (Q3 2026)
27
+
28
+ ### 🧹 Vacuum Cleaners
29
+
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 ✅
65
+
66
+ ### 🎛️ Other Devices
67
+
68
+ ✅ **Phase 3 Other Devices block completed!** See `todo/completed.md` for task details.
69
+
70
+ ---
71
+
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)
78
+
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
85
+
86
+ ---
87
+
88
+ ## 📅 Phase 4: Advanced Features (Q4 2026)
89
+
90
+ ### 🎨 Enhanced Device Control
91
+
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
106
+
107
+ ### 💧 Humidifier Commands
108
+
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)
112
+
113
+ - [ ] **Task 7.2**: Add mode control
114
+ - `setAuto()` - Automatic mode
115
+ - `setManual()` - Manual mode
116
+ - Get target humidity level
117
+
118
+ ### 🌬️ Air Purifier Commands
119
+
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`
124
+
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
129
+
130
+ ### 🔐 Encryption Enhancements
131
+
132
+ - [ ] **Task 18.4**: Add encryption for relay switches
133
+ - Newer relay switches require encryption
134
+ - Same key retrieval process as locks
135
+
136
+ - [ ] **Task 18.5**: Add encryption for air purifiers
137
+ - Newer air purifiers require encryption
138
+ - Command encryption for all control commands
139
+
140
+ - [ ] **Task 18.6**: Add encryption for light strips
141
+ - Newer light strips require encryption
142
+ - Effect commands need encryption
143
+
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
+
149
+ - [ ] **Task 18.8**: Implement key verification
150
+ - `verifyEncryptionKey()` - Test key validity
151
+ - Try commands with key before assuming valid
152
+ - Better error messages for invalid keys
153
+
154
+ ### 📊 Status & Response Parsing
155
+
156
+ - [x] **Task 10.1**: Implement passive status from advertisements ✅
157
+ - Parse device state from BLE advertisements
158
+ - No connection needed for basic status
159
+ - Cache last known state
160
+
161
+ - [x] **Task 10.2**: Add sequence number tracking ✅
162
+ - Monitor `sequence_number` in advertisements
163
+ - Auto-trigger status update when sequence changes
164
+ - Implement for: locks, relay switches, vacuums, air purifiers
165
+
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
+
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
175
+
176
+ ### 🔗 Connection & Error Improvements
177
+
178
+ - [ ] **Task 19.1**: Add specific BLE exceptions
179
+ - `SwitchbotOperationError` - Operation failures
180
+ - `SwitchbotAuthenticationError` - Auth failures
181
+ - `CharacteristicMissingError` - BLE characteristic missing
182
+
183
+ - [ ] **Task 19.4**: Enhance retry logic
184
+ - DBus error backoff (0.25s)
185
+ - `BLEAK_RETRY_EXCEPTIONS` handling
186
+ - Better context in retry errors
187
+
188
+ - [ ] **Task 19.5**: Add response length validation
189
+ - Check minimum expected length
190
+ - Throw errors for truncated responses
191
+ - Include actual vs expected length in error
192
+
193
+ - [ ] **Task 20.3**: Implement command batching
194
+ - Queue multiple commands
195
+ - Send in sequence on single connection
196
+ - Share connection overhead
197
+
198
+ - [ ] **Task 20.4**: Add expected disconnect tracking
199
+ - `_expected_disconnect` flag
200
+ - Differentiate expected vs unexpected disconnects
201
+ - Better error handling for unexpected disconnects
202
+
203
+ - [ ] **Task 20.5**: Implement notification handling
204
+ - Per-command notification futures
205
+ - Timeout handling (5s default)
206
+ - Log unsolicited notifications
207
+
208
+ - [ ] **Task 20.6**: Add characteristic caching
209
+ - Cache read/write characteristics
210
+ - Clear cache on characteristic missing error
211
+ - Avoid repeated characteristic discovery
212
+
213
+ ### 🎯 Advanced Patterns
214
+
215
+ - [ ] **Task 21.3**: Add multi-command support
216
+ - `sendMultipleCommands()` - Send series, return if any succeed
217
+ - `sendCommandSequence()` - Send series, must all succeed
218
+ - Used for Curtain 3 and newer devices
219
+
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
+ - [ ] **Task 21.5**: Add mode setting commands
226
+ - Universal mode setting command: `0x57 0x03`
227
+ - Extended settings command
228
+ - Per-device mode enums
229
+
230
+ - [ ] **Task 21.6**: Add passive polling
231
+ - `PASSIVE_POLL_INTERVAL = 60 * 60 * 24` (24 hours)
232
+ - `pollNeeded()` method
233
+ - Auto-poll inactive devices periodically
234
+
235
+ - [ ] **Task 21.7**: Implement cloud device fetching
236
+ - `getDevices()` - Fetch devices from SwitchBot account
237
+ - Auto-populate model cache from cloud
238
+ - Handle regional APIs (US/CN/EU)
239
+
240
+ ---
241
+
242
+ ## 📈 Medium Priority Enhancements
243
+
244
+ ### Discovery & Advertisement
245
+
246
+ - [ ] **Task 1.4**: Enhance advertisement data structure
247
+ - Add `rawAdvData` field
248
+ - Add `isEncrypted` flag
249
+ - Add `modelFriendlyName` field
250
+
251
+ - [ ] **Task 1.5**: Add advertisement data merging
252
+ - Preserve old values when new data is None
253
+ - Recursive dict merging for nested structures
254
+ - Implement `_merge_data()` helper
255
+
256
+ ### Relay Switch Additional Features
257
+
258
+ - [ ] **Task 5.4**: Add time/energy tracking
259
+ - `getCurrentTimeAndStartTime()` - For energy calculations
260
+ - Command: `0x57 0x0F 0x51 0x01 0x05 0x01 0x00 0x00 0x00`
261
+
262
+ - [ ] **Task 5.5**: Add garage door opener support
263
+ - Variant of relay switch
264
+ - Specific command sequences
265
+ - Model: SwitchBot Relay Switch (garage mode)
266
+
267
+ ### Status Parsing
268
+
269
+ - [ ] **Task 11.1**: Add byte-by-byte response validation
270
+ - Check response length
271
+ - Validate specific byte positions
272
+ - Compare against expected value sets: `{1}`, `{1, 5}`, `{1, 6}`
273
+
274
+ ---
275
+
276
+ ## 🎯 Success Metrics
277
+
278
+ - **Feature Parity**: 90%+ of pySwitchBot commands implemented
279
+ - **Device Coverage**: 95%+ of SwitchBot device types supported
280
+ - **Status Accuracy**: Advertisement-based status for all devices
281
+ - **Connection Efficiency**: 50% reduction in connection overhead via batching
282
+ - **Error Clarity**: Specific error types for all failure modes
283
+
284
+ ---
285
+
286
+ ## 📝 Notes
287
+
288
+ ### Task Completion Process
289
+ 1. Move completed task from this file to `completed.md`
290
+ 2. Add completion date and any notes
291
+ 3. Update "Last Updated" timestamp
292
+ 4. Reference any relevant PRs or commits
293
+
294
+ ### Priority Levels
295
+ - **High Priority**: Core functionality, user-facing features
296
+ - **Medium Priority**: Enhancements, optimizations
297
+ - **Low Priority**: Nice-to-have features
298
+
299
+ ### Reference
300
+ - Full comparison details: [PYSWITCHBOT_COMPARISON.md](../PYSWITCHBOT_COMPARISON.md)
301
+ - pySwitchBot Repository: https://github.com/Danielhiversen/pySwitchbot
302
+ - SwitchBot BLE API: https://github.com/OpenWonderLabs/SwitchBotAPI-BLE
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src"
5
+ },
6
+ "include": [
7
+ "src/**/*"
8
+ ],
9
+ "exclude": [
10
+ "test",
11
+ "**/*.spec.ts",
12
+ "**/*.test.ts",
13
+ ".dev-archive/**/*",
14
+ "dist",
15
+ "node_modules"
16
+ ]
17
+ }