node-switchbot 4.0.0-beta.9 → 4.0.1

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 (417) hide show
  1. package/BLE.md +215 -838
  2. package/CHANGELOG.md +163 -1438
  3. package/OpenAPI.md +169 -135
  4. package/README.md +1 -1
  5. package/dist/ble.d.ts +14 -1
  6. package/dist/ble.d.ts.map +1 -1
  7. package/dist/ble.js +241 -39
  8. package/dist/ble.js.map +1 -1
  9. package/dist/devices/base.d.ts +97 -1
  10. package/dist/devices/base.d.ts.map +1 -1
  11. package/dist/devices/base.js +204 -2
  12. package/dist/devices/base.js.map +1 -1
  13. package/dist/devices/device-override-state-during-connection.d.ts +27 -0
  14. package/dist/devices/device-override-state-during-connection.d.ts.map +1 -0
  15. package/dist/devices/device-override-state-during-connection.js +45 -0
  16. package/dist/devices/device-override-state-during-connection.js.map +1 -0
  17. package/dist/devices/index.d.ts +36 -0
  18. package/dist/devices/index.d.ts.map +1 -1
  19. package/dist/devices/index.js +36 -0
  20. package/dist/devices/index.js.map +1 -1
  21. package/dist/devices/sequence-device.d.ts +52 -0
  22. package/dist/devices/sequence-device.d.ts.map +1 -0
  23. package/dist/devices/sequence-device.js +91 -0
  24. package/dist/devices/sequence-device.js.map +1 -0
  25. package/dist/devices/wo-ai-hub.d.ts +9 -0
  26. package/dist/devices/wo-ai-hub.d.ts.map +1 -0
  27. package/dist/devices/wo-ai-hub.js +25 -0
  28. package/dist/devices/wo-ai-hub.js.map +1 -0
  29. package/dist/devices/wo-air-purifier-pm25.d.ts +29 -0
  30. package/dist/devices/wo-air-purifier-pm25.d.ts.map +1 -0
  31. package/dist/devices/wo-air-purifier-pm25.js +144 -0
  32. package/dist/devices/wo-air-purifier-pm25.js.map +1 -0
  33. package/dist/devices/wo-air-purifier.d.ts +21 -4
  34. package/dist/devices/wo-air-purifier.d.ts.map +1 -1
  35. package/dist/devices/wo-air-purifier.js +111 -61
  36. package/dist/devices/wo-air-purifier.js.map +1 -1
  37. package/dist/devices/wo-art-frame.d.ts +8 -0
  38. package/dist/devices/wo-art-frame.d.ts.map +1 -0
  39. package/dist/devices/wo-art-frame.js +12 -0
  40. package/dist/devices/wo-art-frame.js.map +1 -0
  41. package/dist/devices/wo-blind-tilt.d.ts +2 -16
  42. package/dist/devices/wo-blind-tilt.d.ts.map +1 -1
  43. package/dist/devices/wo-blind-tilt.js +135 -62
  44. package/dist/devices/wo-blind-tilt.js.map +1 -1
  45. package/dist/devices/wo-bulb.d.ts +37 -1
  46. package/dist/devices/wo-bulb.d.ts.map +1 -1
  47. package/dist/devices/wo-bulb.js +196 -51
  48. package/dist/devices/wo-bulb.js.map +1 -1
  49. package/dist/devices/wo-candle-warmer-lamp.d.ts +25 -0
  50. package/dist/devices/wo-candle-warmer-lamp.d.ts.map +1 -0
  51. package/dist/devices/wo-candle-warmer-lamp.js +81 -0
  52. package/dist/devices/wo-candle-warmer-lamp.js.map +1 -0
  53. package/dist/devices/wo-circulator-fan.d.ts +8 -0
  54. package/dist/devices/wo-circulator-fan.d.ts.map +1 -0
  55. package/dist/devices/wo-circulator-fan.js +12 -0
  56. package/dist/devices/wo-circulator-fan.js.map +1 -0
  57. package/dist/devices/wo-climate-panel.d.ts +8 -0
  58. package/dist/devices/wo-climate-panel.d.ts.map +1 -0
  59. package/dist/devices/wo-climate-panel.js +12 -0
  60. package/dist/devices/wo-climate-panel.js.map +1 -0
  61. package/dist/devices/wo-contact.d.ts +1 -1
  62. package/dist/devices/wo-contact.d.ts.map +1 -1
  63. package/dist/devices/wo-contact.js +19 -35
  64. package/dist/devices/wo-contact.js.map +1 -1
  65. package/dist/devices/wo-curtain.d.ts +17 -1
  66. package/dist/devices/wo-curtain.d.ts.map +1 -1
  67. package/dist/devices/wo-curtain.js +119 -27
  68. package/dist/devices/wo-curtain.js.map +1 -1
  69. package/dist/devices/wo-floor-lamp.d.ts +8 -0
  70. package/dist/devices/wo-floor-lamp.d.ts.map +1 -0
  71. package/dist/devices/wo-floor-lamp.js +12 -0
  72. package/dist/devices/wo-floor-lamp.js.map +1 -0
  73. package/dist/devices/wo-garage-door-opener.d.ts +8 -0
  74. package/dist/devices/wo-garage-door-opener.d.ts.map +1 -0
  75. package/dist/devices/wo-garage-door-opener.js +12 -0
  76. package/dist/devices/wo-garage-door-opener.js.map +1 -0
  77. package/dist/devices/wo-hand.d.ts +22 -6
  78. package/dist/devices/wo-hand.d.ts.map +1 -1
  79. package/dist/devices/wo-hand.js +55 -39
  80. package/dist/devices/wo-hand.js.map +1 -1
  81. package/dist/devices/wo-hub2.d.ts +1 -1
  82. package/dist/devices/wo-hub2.d.ts.map +1 -1
  83. package/dist/devices/wo-hub2.js +17 -33
  84. package/dist/devices/wo-hub2.js.map +1 -1
  85. package/dist/devices/wo-hubmini-matter.d.ts +8 -0
  86. package/dist/devices/wo-hubmini-matter.d.ts.map +1 -0
  87. package/dist/devices/wo-hubmini-matter.js +12 -0
  88. package/dist/devices/wo-hubmini-matter.js.map +1 -0
  89. package/dist/devices/wo-humi.d.ts +18 -2
  90. package/dist/devices/wo-humi.d.ts.map +1 -1
  91. package/dist/devices/wo-humi.js +60 -36
  92. package/dist/devices/wo-humi.js.map +1 -1
  93. package/dist/devices/wo-humi2.d.ts.map +1 -1
  94. package/dist/devices/wo-humi2.js.map +1 -1
  95. package/dist/devices/wo-keypad-vision-pro.d.ts +18 -0
  96. package/dist/devices/wo-keypad-vision-pro.d.ts.map +1 -0
  97. package/dist/devices/wo-keypad-vision-pro.js +15 -0
  98. package/dist/devices/wo-keypad-vision-pro.js.map +1 -0
  99. package/dist/devices/wo-keypad-vision.d.ts +8 -0
  100. package/dist/devices/wo-keypad-vision.d.ts.map +1 -0
  101. package/dist/devices/wo-keypad-vision.js +12 -0
  102. package/dist/devices/wo-keypad-vision.js.map +1 -0
  103. package/dist/devices/wo-keypad.d.ts +1 -1
  104. package/dist/devices/wo-keypad.d.ts.map +1 -1
  105. package/dist/devices/wo-keypad.js +14 -30
  106. package/dist/devices/wo-keypad.js.map +1 -1
  107. package/dist/devices/wo-leak.d.ts +1 -1
  108. package/dist/devices/wo-leak.d.ts.map +1 -1
  109. package/dist/devices/wo-leak.js +15 -31
  110. package/dist/devices/wo-leak.js.map +1 -1
  111. package/dist/devices/wo-lock-lite.d.ts +7 -0
  112. package/dist/devices/wo-lock-lite.d.ts.map +1 -0
  113. package/dist/devices/wo-lock-lite.js +11 -0
  114. package/dist/devices/wo-lock-lite.js.map +1 -0
  115. package/dist/devices/wo-lock-pro-wifi.d.ts +7 -0
  116. package/dist/devices/wo-lock-pro-wifi.d.ts.map +1 -0
  117. package/dist/devices/wo-lock-pro-wifi.js +11 -0
  118. package/dist/devices/wo-lock-pro-wifi.js.map +1 -0
  119. package/dist/devices/wo-lock-pro.d.ts +12 -3
  120. package/dist/devices/wo-lock-pro.d.ts.map +1 -1
  121. package/dist/devices/wo-lock-pro.js +83 -37
  122. package/dist/devices/wo-lock-pro.js.map +1 -1
  123. package/dist/devices/wo-lock-vision-pro.d.ts +7 -0
  124. package/dist/devices/wo-lock-vision-pro.d.ts.map +1 -0
  125. package/dist/devices/wo-lock-vision-pro.js +11 -0
  126. package/dist/devices/wo-lock-vision-pro.js.map +1 -0
  127. package/dist/devices/wo-lock-vision.d.ts +7 -0
  128. package/dist/devices/wo-lock-vision.d.ts.map +1 -0
  129. package/dist/devices/wo-lock-vision.js +11 -0
  130. package/dist/devices/wo-lock-vision.js.map +1 -0
  131. package/dist/devices/wo-lock.d.ts +8 -3
  132. package/dist/devices/wo-lock.d.ts.map +1 -1
  133. package/dist/devices/wo-lock.js +75 -36
  134. package/dist/devices/wo-lock.js.map +1 -1
  135. package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts +21 -0
  136. package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts.map +1 -0
  137. package/dist/devices/wo-pan-tilt-cam-plus-3k.js +87 -0
  138. package/dist/devices/wo-pan-tilt-cam-plus-3k.js.map +1 -0
  139. package/dist/devices/wo-plug-mini-us.d.ts +3 -3
  140. package/dist/devices/wo-plug-mini-us.d.ts.map +1 -1
  141. package/dist/devices/wo-plug-mini-us.js +25 -35
  142. package/dist/devices/wo-plug-mini-us.js.map +1 -1
  143. package/dist/devices/wo-presence.d.ts +1 -1
  144. package/dist/devices/wo-presence.d.ts.map +1 -1
  145. package/dist/devices/wo-presence.js +17 -33
  146. package/dist/devices/wo-presence.js.map +1 -1
  147. package/dist/devices/wo-relay-switch-1.d.ts +19 -3
  148. package/dist/devices/wo-relay-switch-1.d.ts.map +1 -1
  149. package/dist/devices/wo-relay-switch-1.js +90 -42
  150. package/dist/devices/wo-relay-switch-1.js.map +1 -1
  151. package/dist/devices/wo-relay-switch-2pm.d.ts +21 -0
  152. package/dist/devices/wo-relay-switch-2pm.d.ts.map +1 -0
  153. package/dist/devices/wo-relay-switch-2pm.js +37 -0
  154. package/dist/devices/wo-relay-switch-2pm.js.map +1 -0
  155. package/dist/devices/wo-remote-with-screen.d.ts +9 -0
  156. package/dist/devices/wo-remote-with-screen.d.ts.map +1 -0
  157. package/dist/devices/wo-remote-with-screen.js +22 -0
  158. package/dist/devices/wo-remote-with-screen.js.map +1 -0
  159. package/dist/devices/wo-remote.d.ts +1 -1
  160. package/dist/devices/wo-remote.d.ts.map +1 -1
  161. package/dist/devices/wo-remote.js +13 -29
  162. package/dist/devices/wo-remote.js.map +1 -1
  163. package/dist/devices/wo-rgbic-bulb.d.ts +29 -0
  164. package/dist/devices/wo-rgbic-bulb.d.ts.map +1 -0
  165. package/dist/devices/wo-rgbic-bulb.js +84 -0
  166. package/dist/devices/wo-rgbic-bulb.js.map +1 -0
  167. package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts +29 -0
  168. package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts.map +1 -0
  169. package/dist/devices/wo-rgbic-neon-wire-rope-light.js +113 -0
  170. package/dist/devices/wo-rgbic-neon-wire-rope-light.js.map +1 -0
  171. package/dist/devices/wo-rgbicww-floor-lamp.d.ts +8 -0
  172. package/dist/devices/wo-rgbicww-floor-lamp.d.ts.map +1 -0
  173. package/dist/devices/wo-rgbicww-floor-lamp.js +12 -0
  174. package/dist/devices/wo-rgbicww-floor-lamp.js.map +1 -0
  175. package/dist/devices/wo-rgbicww-strip-light.d.ts +8 -0
  176. package/dist/devices/wo-rgbicww-strip-light.d.ts.map +1 -0
  177. package/dist/devices/wo-rgbicww-strip-light.js +12 -0
  178. package/dist/devices/wo-rgbicww-strip-light.js.map +1 -0
  179. package/dist/devices/wo-roller-shade.d.ts +8 -0
  180. package/dist/devices/wo-roller-shade.d.ts.map +1 -0
  181. package/dist/devices/wo-roller-shade.js +12 -0
  182. package/dist/devices/wo-roller-shade.js.map +1 -0
  183. package/dist/devices/wo-sensor-th.d.ts +1 -1
  184. package/dist/devices/wo-sensor-th.d.ts.map +1 -1
  185. package/dist/devices/wo-sensor-th.js +18 -34
  186. package/dist/devices/wo-sensor-th.js.map +1 -1
  187. package/dist/devices/wo-smart-thermostat-radiator.d.ts +8 -0
  188. package/dist/devices/wo-smart-thermostat-radiator.d.ts.map +1 -0
  189. package/dist/devices/wo-smart-thermostat-radiator.js +12 -0
  190. package/dist/devices/wo-smart-thermostat-radiator.js.map +1 -0
  191. package/dist/devices/wo-strip-light-3.d.ts +8 -0
  192. package/dist/devices/wo-strip-light-3.d.ts.map +1 -0
  193. package/dist/devices/wo-strip-light-3.js +12 -0
  194. package/dist/devices/wo-strip-light-3.js.map +1 -0
  195. package/dist/devices/wo-vacuum-k10-plus.d.ts +7 -0
  196. package/dist/devices/wo-vacuum-k10-plus.d.ts.map +1 -0
  197. package/dist/devices/wo-vacuum-k10-plus.js +11 -0
  198. package/dist/devices/wo-vacuum-k10-plus.js.map +1 -0
  199. package/dist/devices/wo-vacuum-k10-pro-combo.d.ts +7 -0
  200. package/dist/devices/wo-vacuum-k10-pro-combo.d.ts.map +1 -0
  201. package/dist/devices/wo-vacuum-k10-pro-combo.js +11 -0
  202. package/dist/devices/wo-vacuum-k10-pro-combo.js.map +1 -0
  203. package/dist/devices/wo-vacuum-k10-pro.d.ts +7 -0
  204. package/dist/devices/wo-vacuum-k10-pro.d.ts.map +1 -0
  205. package/dist/devices/wo-vacuum-k10-pro.js +11 -0
  206. package/dist/devices/wo-vacuum-k10-pro.js.map +1 -0
  207. package/dist/devices/wo-vacuum-k11-plus.d.ts +7 -0
  208. package/dist/devices/wo-vacuum-k11-plus.d.ts.map +1 -0
  209. package/dist/devices/wo-vacuum-k11-plus.js +11 -0
  210. package/dist/devices/wo-vacuum-k11-plus.js.map +1 -0
  211. package/dist/devices/wo-vacuum-k20.d.ts +7 -0
  212. package/dist/devices/wo-vacuum-k20.d.ts.map +1 -0
  213. package/dist/devices/wo-vacuum-k20.js +11 -0
  214. package/dist/devices/wo-vacuum-k20.js.map +1 -0
  215. package/dist/devices/wo-vacuum-s10.d.ts +7 -0
  216. package/dist/devices/wo-vacuum-s10.d.ts.map +1 -0
  217. package/dist/devices/wo-vacuum-s10.js +11 -0
  218. package/dist/devices/wo-vacuum-s10.js.map +1 -0
  219. package/dist/devices/wo-vacuum-s20.d.ts +7 -0
  220. package/dist/devices/wo-vacuum-s20.d.ts.map +1 -0
  221. package/dist/devices/wo-vacuum-s20.js +11 -0
  222. package/dist/devices/wo-vacuum-s20.js.map +1 -0
  223. package/dist/devices/wo-vacuum.d.ts +44 -0
  224. package/dist/devices/wo-vacuum.d.ts.map +1 -0
  225. package/dist/devices/wo-vacuum.js +143 -0
  226. package/dist/devices/wo-vacuum.js.map +1 -0
  227. package/dist/devices/wo-water-detector.d.ts +9 -0
  228. package/dist/devices/wo-water-detector.d.ts.map +1 -0
  229. package/dist/devices/wo-water-detector.js +20 -0
  230. package/dist/devices/wo-water-detector.js.map +1 -0
  231. package/dist/errors.d.ts +20 -0
  232. package/dist/errors.d.ts.map +1 -1
  233. package/dist/errors.js +31 -1
  234. package/dist/errors.js.map +1 -1
  235. package/dist/index.d.ts +4 -2
  236. package/dist/index.d.ts.map +1 -1
  237. package/dist/index.js +3 -1
  238. package/dist/index.js.map +1 -1
  239. package/dist/settings.d.ts +25 -0
  240. package/dist/settings.d.ts.map +1 -1
  241. package/dist/settings.js +86 -6
  242. package/dist/settings.js.map +1 -1
  243. package/dist/switchbot.d.ts +1 -0
  244. package/dist/switchbot.d.ts.map +1 -1
  245. package/dist/switchbot.js +152 -34
  246. package/dist/switchbot.js.map +1 -1
  247. package/dist/types/ble.d.ts +6 -0
  248. package/dist/types/ble.d.ts.map +1 -1
  249. package/dist/types/ble.js.map +1 -1
  250. package/dist/types/device.d.ts +81 -2
  251. package/dist/types/device.d.ts.map +1 -1
  252. package/dist/types/index.d.ts +18 -0
  253. package/dist/types/index.d.ts.map +1 -1
  254. package/dist/types/index.js.map +1 -1
  255. package/dist/utils/fallback-handler.js +0 -1
  256. package/dist/utils/fallback-handler.js.map +1 -1
  257. package/dist/utils/index.d.ts +21 -1
  258. package/dist/utils/index.d.ts.map +1 -1
  259. package/dist/utils/index.js +49 -0
  260. package/dist/utils/index.js.map +1 -1
  261. package/dist/utils/relay-encryption.d.ts +10 -0
  262. package/dist/utils/relay-encryption.d.ts.map +1 -0
  263. package/dist/utils/relay-encryption.js +23 -0
  264. package/dist/utils/relay-encryption.js.map +1 -0
  265. package/dist/utils/retry.d.ts.map +1 -1
  266. package/dist/utils/retry.js +49 -6
  267. package/dist/utils/retry.js.map +1 -1
  268. package/package.json +32 -16
  269. package/.gitattributes +0 -2
  270. package/.github/copilot-instructions.md +0 -179
  271. package/.github/dependabot.yml +0 -17
  272. package/.github/labeler.yml +0 -38
  273. package/.github/npm-version-script-esm.js +0 -97
  274. package/.github/workflows/beta-release.yml +0 -52
  275. package/.github/workflows/release.yml +0 -71
  276. package/.github/workflows/stale.yml +0 -12
  277. package/branding/Node_x_SwitchBot.svg +0 -8
  278. package/branding/icon.png +0 -0
  279. package/branding/switchbot.png +0 -0
  280. package/docs/.nojekyll +0 -1
  281. package/docs/assets/hierarchy.js +0 -1
  282. package/docs/assets/highlight.css +0 -85
  283. package/docs/assets/icons.js +0 -18
  284. package/docs/assets/icons.svg +0 -1
  285. package/docs/assets/main.js +0 -60
  286. package/docs/assets/navigation.js +0 -1
  287. package/docs/assets/search.js +0 -1
  288. package/docs/assets/style.css +0 -1633
  289. package/docs/classes/APIError.html +0 -6
  290. package/docs/classes/APINotAvailableError.html +0 -4
  291. package/docs/classes/BLEConnection.html +0 -21
  292. package/docs/classes/BLENotAvailableError.html +0 -4
  293. package/docs/classes/BLEScanner.html +0 -17
  294. package/docs/classes/CommandFailedError.html +0 -6
  295. package/docs/classes/ConnectionTimeoutError.html +0 -5
  296. package/docs/classes/DeviceManager.html +0 -25
  297. package/docs/classes/DeviceNotFoundError.html +0 -4
  298. package/docs/classes/DiscoveryError.html +0 -5
  299. package/docs/classes/OpenAPIClient.html +0 -66
  300. package/docs/classes/SwitchBot.html +0 -22
  301. package/docs/classes/SwitchBotDevice.html +0 -56
  302. package/docs/classes/SwitchBotError.html +0 -4
  303. package/docs/classes/ValidationError.html +0 -5
  304. package/docs/classes/WoAirPurifier.html +0 -63
  305. package/docs/classes/WoAirPurifierTable.html +0 -64
  306. package/docs/classes/WoBlindTilt.html +0 -67
  307. package/docs/classes/WoBulb.html +0 -65
  308. package/docs/classes/WoCeilingLight.html +0 -66
  309. package/docs/classes/WoContact.html +0 -55
  310. package/docs/classes/WoCurtain.html +0 -63
  311. package/docs/classes/WoHand.html +0 -69
  312. package/docs/classes/WoHub2.html +0 -55
  313. package/docs/classes/WoHub3.html +0 -56
  314. package/docs/classes/WoHumi.html +0 -63
  315. package/docs/classes/WoHumi2.html +0 -64
  316. package/docs/classes/WoIOSensorTH.html +0 -56
  317. package/docs/classes/WoKeypad.html +0 -56
  318. package/docs/classes/WoLeak.html +0 -55
  319. package/docs/classes/WoPlugMiniJP.html +0 -62
  320. package/docs/classes/WoPlugMiniUS.html +0 -61
  321. package/docs/classes/WoPresence.html +0 -55
  322. package/docs/classes/WoRelaySwitch1.html +0 -61
  323. package/docs/classes/WoRelaySwitch1PM.html +0 -62
  324. package/docs/classes/WoRemote.html +0 -56
  325. package/docs/classes/WoSensorTH.html +0 -55
  326. package/docs/classes/WoSensorTHPlus.html +0 -56
  327. package/docs/classes/WoSensorTHPro.html +0 -56
  328. package/docs/classes/WoSensorTHProCO2.html +0 -56
  329. package/docs/classes/WoSmartLock.html +0 -59
  330. package/docs/classes/WoSmartLockPro.html +0 -61
  331. package/docs/classes/WoStrip.html +0 -66
  332. package/docs/enums/LogLevel.html +0 -7
  333. package/docs/enums/SwitchBotBLEModel.html +0 -40
  334. package/docs/enums/SwitchBotBLEModelName.html +0 -40
  335. package/docs/functions/updateBaseURL.html +0 -3
  336. package/docs/hierarchy.html +0 -1
  337. package/docs/index.html +0 -55
  338. package/docs/interfaces/APICommandRequest.html +0 -5
  339. package/docs/interfaces/APICommandResponse.html +0 -5
  340. package/docs/interfaces/APIDevice.html +0 -18
  341. package/docs/interfaces/APIDeviceStatus.html +0 -36
  342. package/docs/interfaces/APIErrorResponse.html +0 -5
  343. package/docs/interfaces/APIResponse.html +0 -5
  344. package/docs/interfaces/AirPurifierCommands.html +0 -5
  345. package/docs/interfaces/AirPurifierServiceData.html +0 -29
  346. package/docs/interfaces/AirPurifierStatus.html +0 -17
  347. package/docs/interfaces/BLEAdvertisement.html +0 -7
  348. package/docs/interfaces/BLEScanOptions.html +0 -10
  349. package/docs/interfaces/BLEServiceData.html +0 -27
  350. package/docs/interfaces/BlindTiltCommands.html +0 -7
  351. package/docs/interfaces/BlindTiltServiceData.html +0 -30
  352. package/docs/interfaces/BlindTiltStatus.html +0 -15
  353. package/docs/interfaces/BotCommands.html +0 -4
  354. package/docs/interfaces/BotServiceData.html +0 -27
  355. package/docs/interfaces/BotStatus.html +0 -14
  356. package/docs/interfaces/BulbCommands.html +0 -6
  357. package/docs/interfaces/BulbServiceData.html +0 -35
  358. package/docs/interfaces/BulbStatus.html +0 -16
  359. package/docs/interfaces/CeilingLightCommands.html +0 -6
  360. package/docs/interfaces/CeilingLightServiceData.html +0 -35
  361. package/docs/interfaces/CeilingLightStatus.html +0 -16
  362. package/docs/interfaces/CommandResult.html +0 -12
  363. package/docs/interfaces/ContactServiceData.html +0 -30
  364. package/docs/interfaces/ContactStatus.html +0 -15
  365. package/docs/interfaces/CurtainCommands.html +0 -5
  366. package/docs/interfaces/CurtainServiceData.html +0 -31
  367. package/docs/interfaces/CurtainStatus.html +0 -17
  368. package/docs/interfaces/DeviceInfo.html +0 -36
  369. package/docs/interfaces/DeviceListResponse.html +0 -4
  370. package/docs/interfaces/DeviceStatus.html +0 -12
  371. package/docs/interfaces/DiscoveryOptions.html +0 -14
  372. package/docs/interfaces/HubServiceData.html +0 -31
  373. package/docs/interfaces/HubStatus.html +0 -15
  374. package/docs/interfaces/HumidifierCommands.html +0 -5
  375. package/docs/interfaces/HumidifierServiceData.html +0 -31
  376. package/docs/interfaces/HumidifierStatus.html +0 -18
  377. package/docs/interfaces/KeypadStatus.html +0 -13
  378. package/docs/interfaces/LeakServiceData.html +0 -28
  379. package/docs/interfaces/LeakStatus.html +0 -13
  380. package/docs/interfaces/LockCommands.html +0 -3
  381. package/docs/interfaces/LockServiceData.html +0 -29
  382. package/docs/interfaces/LockStatus.html +0 -15
  383. package/docs/interfaces/MeterServiceData.html +0 -30
  384. package/docs/interfaces/MeterStatus.html +0 -15
  385. package/docs/interfaces/MotionServiceData.html +0 -30
  386. package/docs/interfaces/MotionStatus.html +0 -14
  387. package/docs/interfaces/PlugCommands.html +0 -4
  388. package/docs/interfaces/PlugServiceData.html +0 -33
  389. package/docs/interfaces/PlugStatus.html +0 -16
  390. package/docs/interfaces/PresenceServiceData.html +0 -29
  391. package/docs/interfaces/PresenceStatus.html +0 -14
  392. package/docs/interfaces/RelaySwitchCommands.html +0 -4
  393. package/docs/interfaces/RelaySwitchServiceData.html +0 -30
  394. package/docs/interfaces/RelaySwitchStatus.html +0 -16
  395. package/docs/interfaces/RemoteStatus.html +0 -12
  396. package/docs/interfaces/SceneListResponse.html +0 -3
  397. package/docs/interfaces/StripCommands.html +0 -6
  398. package/docs/interfaces/StripServiceData.html +0 -35
  399. package/docs/interfaces/StripStatus.html +0 -16
  400. package/docs/interfaces/SwitchBotConfig.html +0 -30
  401. package/docs/interfaces/WebhookConfig.html +0 -4
  402. package/docs/interfaces/WebhookDetails.html +0 -7
  403. package/docs/interfaces/WebhookQueryResponse.html +0 -5
  404. package/docs/interfaces/WebhookSetupResponse.html +0 -5
  405. package/docs/media/BLE.md +0 -1259
  406. package/docs/media/OpenAPI.md +0 -186
  407. package/docs/modules.html +0 -1
  408. package/docs/types/ConnectionType.html +0 -2
  409. package/docs/types/PhysicalDeviceType.html +0 -2
  410. package/docs/types/VirtualDeviceType.html +0 -2
  411. package/docs/variables/urls.html +0 -1
  412. package/tmp-switchbot-scan.mjs +0 -79
  413. package/todo/PYSWITCHBOT_COMPARISON.md +0 -484
  414. package/todo/README.md +0 -68
  415. package/todo/completed.md +0 -65
  416. package/todo/todo.md +0 -369
  417. package/tsconfig.build.json +0 -17
package/OpenAPI.md CHANGED
@@ -1,186 +1,220 @@
1
1
  # SwitchBot OpenAPI Documentation
2
2
 
3
- The `SwitchBotOpenAPI` class allows you to interact with SwitchBot devices using the SwitchBot OpenAPI. This documentation provides an overview of how to install, set up, and use the various methods available in the `SwitchBotOpenAPI` class.
3
+ OpenAPI support in `node-switchbot` is part of the v4 unified architecture. The primary public API is the `SwitchBot` class, which can run in API-only mode or in hybrid BLE + OpenAPI mode.
4
4
 
5
- ## Table of Contents
5
+ This document covers:
6
6
 
7
- - [OpenAPI](#openapi)
8
- - [Importing and Setting Up](#importing-and-setting-up)
9
- - [`SwitchBotOpenAPI` Object](#switchbotopenapi-object)
10
- - [`getDevices()` Method](#getdevices-method)
11
- - [`controlDevice()` Method](#controldevice-method)
12
- - [`getDeviceStatus()` Method](#getdevicestatus-method)
13
- - [`setupWebhook()` Method](#setupwebhook-method)
14
- - [`deleteWebhook()` Method](#deletewebhook-method)
15
- - [Logging](#logging)
16
- - [Supported Devices](#supported-devices)
7
+ - Using OpenAPI through the unified `SwitchBot` class
8
+ - Running in API-only mode
9
+ - Using the lower-level `OpenAPIClient` directly
10
+ - Webhook and scene helpers exposed by `OpenAPIClient`
17
11
 
18
- ## OpenAPI
12
+ ## v4 OpenAPI Model
19
13
 
20
- ### Importing and Setting Up
14
+ In v4.0.0:
21
15
 
22
- To use the `SwitchBotOpenAPI` class, you need to import it and create an instance with your SwitchBot token and secret.
16
+ - `SwitchBot` is the recommended entry point
17
+ - OpenAPI is enabled when `token` and `secret` are provided
18
+ - You can run API-only by setting `enableBLE: false`
19
+ - You can run hybrid mode by combining credentials with `enableBLE: true`
20
+ - Discovered devices are accessed through `switchbot.devices`
23
21
 
24
- ```typescript
25
- import { SwitchBotOpenAPI } from 'node-switchbot'
22
+ ## Credentials
26
23
 
27
- const switchBotAPI = new SwitchBotOpenAPI('your-token', 'your-secret')
24
+ To use OpenAPI, you need a SwitchBot token and secret.
28
25
 
29
- // Example usage
30
- switchBotAPI.getDevices().then((devices) => {
31
- console.log('Devices:', devices)
32
- }).catch((error) => {
33
- console.error('Error getting devices:', error)
34
- })
35
- ```
26
+ In the SwitchBot mobile app:
36
27
 
37
- ### SwitchBotOpenAPI Object
28
+ 1. Open your profile
29
+ 2. Open preferences
30
+ 3. Tap the app version multiple times to unlock developer options
31
+ 4. Copy your token and secret
38
32
 
39
- The `SwitchBotOpenAPI` object provides several methods to interact with SwitchBot devices. Below are examples of how to use each method.
33
+ ## API-Only Mode
40
34
 
41
- #### `getDevices()` Method
42
-
43
- Fetches the list of devices associated with your SwitchBot account.
35
+ Use this mode on Windows or anywhere you want cloud-only operation.
44
36
 
45
37
  ```typescript
46
- async function getDevices() {
47
- try {
48
- const devices = await switchBotAPI.getDevices()
49
- console.log('Devices:', devices)
50
- } catch (e: any) {
51
- console.error(`failed to get devices, Error: ${e.message ?? e}`)
52
- }
53
- }
38
+ import { LogLevel, SwitchBot } from 'node-switchbot'
54
39
 
55
- // Example usage
56
- getDevices()
57
- ```
40
+ const switchbot = new SwitchBot({
41
+ token: 'YOUR_TOKEN',
42
+ secret: 'YOUR_SECRET',
43
+ enableBLE: false,
44
+ logLevel: LogLevel.INFO,
45
+ })
58
46
 
59
- #### `controlDevice()` Method
47
+ const devices = await switchbot.discover({
48
+ scanBLE: false,
49
+ fetchAPI: true,
50
+ })
60
51
 
61
- Sends a command to control a specific device.
52
+ console.log(`Found ${devices.length} device(s) from OpenAPI`)
62
53
 
63
- ```typescript
64
- async function controlDevice(deviceId, command, parameter) {
65
- try {
66
- const response = await switchBotAPI.controlDevice(deviceId, command, parameter)
67
- console.log('Control Device Response:', response)
68
- } catch (error) {
69
- console.error('Error controlling device:', error)
70
- }
54
+ const bot = switchbot.devices.get('YOUR_DEVICE_ID')
55
+ if (bot) {
56
+ await bot.turnOn()
57
+ const status = await bot.getStatus()
58
+ console.log(status)
71
59
  }
72
60
 
73
- // Example usage
74
- controlDevice('your-device-id', 'turnOn', 'default')
61
+ await switchbot.cleanup()
75
62
  ```
76
63
 
77
- #### `getDeviceStatus()` Method
64
+ ## Hybrid Mode
78
65
 
79
- Fetches the current status of a specific device.
66
+ If you want local BLE when available and cloud fallback when needed:
80
67
 
81
68
  ```typescript
82
- async function getDeviceStatus(deviceId) {
83
- try {
84
- const status = await switchBotAPI.getDeviceStatus(deviceId)
85
- console.log('Device Status:', status)
86
- } catch (error) {
87
- console.error('Error getting device status:', error)
88
- }
69
+ import { LogLevel, SwitchBot } from 'node-switchbot'
70
+
71
+ const switchbot = new SwitchBot({
72
+ token: 'YOUR_TOKEN',
73
+ secret: 'YOUR_SECRET',
74
+ enableBLE: true,
75
+ enableFallback: true,
76
+ enableConnectionIntelligence: true,
77
+ enableCircuitBreaker: true,
78
+ enableRetry: true,
79
+ logLevel: LogLevel.INFO,
80
+ })
81
+
82
+ await switchbot.discover({
83
+ scanBLE: true,
84
+ fetchAPI: true,
85
+ timeout: 10_000,
86
+ })
87
+
88
+ const lock = switchbot.devices.get('YOUR_LOCK_ID')
89
+ if (lock) {
90
+ await lock.lock()
89
91
  }
90
92
 
91
- // Example usage
92
- getDeviceStatus('your-device-id')
93
+ await switchbot.cleanup()
93
94
  ```
94
95
 
95
- #### `setupWebhook()` Method
96
+ ## Discovery Through OpenAPI
96
97
 
97
- Sets up a webhook to receive events from SwitchBot devices.
98
+ When OpenAPI is enabled, `switchbot.discover()` can fetch cloud-registered devices and merge them with BLE discoveries.
98
99
 
99
- ```typescript
100
- async function setupWebhook(url) {
101
- try {
102
- await switchBotAPI.setupWebhook(url)
103
- console.log('Webhook setup successfully')
104
- } catch (error) {
105
- console.error('Error setting up webhook:', error)
106
- }
107
- }
100
+ Supported discovery options:
108
101
 
109
- // Example usage
110
- setupWebhook('http://your-webhook-url')
102
+ | Property | Type | Description |
103
+ | :-- | :-- | :-- |
104
+ | `scanBLE` | `boolean` | Enable BLE discovery for this call |
105
+ | `fetchAPI` | `boolean` | Enable OpenAPI device fetch for this call |
106
+ | `timeout` | `number` | Discovery timeout in milliseconds |
107
+ | `deviceId` | `string` | Filter by SwitchBot device ID |
108
+ | `mac` | `string` | Filter by MAC address |
109
+ | `deviceType` | `string` | Filter by device type |
110
+
111
+ ## Device Manager Pattern
112
+
113
+ After discovery:
114
+
115
+ ```typescript
116
+ const devices = switchbot.devices.list()
117
+ const curtain = switchbot.devices.get('YOUR_CURTAIN_ID')
118
+ const locks = switchbot.devices.getByType('WoSmartLock')
111
119
  ```
112
120
 
113
- #### `deleteWebhook()` Method
121
+ Every discovered device exposes the unified command surface for its class, regardless of whether the eventual command runs over API, BLE, or a fallback path.
114
122
 
115
- Deletes an existing webhook.
123
+ ## Lower-Level `OpenAPIClient`
124
+
125
+ If you need direct access to the SwitchBot cloud API without the full hybrid layer, use `OpenAPIClient`.
116
126
 
117
127
  ```typescript
118
- async function deleteWebhook(url) {
119
- try {
120
- await switchBotAPI.deleteWebhook(url)
121
- console.log('Webhook deleted successfully')
122
- } catch (error) {
123
- console.error('Error deleting webhook:', error)
124
- }
125
- }
128
+ import { OpenAPIClient } from 'node-switchbot'
129
+
130
+ const api = new OpenAPIClient('YOUR_TOKEN', 'YOUR_SECRET')
131
+
132
+ const devices = await api.getDevices()
133
+ console.log(devices)
134
+
135
+ const status = await api.getStatus('YOUR_DEVICE_ID')
136
+ console.log(status)
126
137
 
127
- // Example usage
128
- deleteWebhook('http://your-webhook-url')
138
+ await api.sendCommand('YOUR_DEVICE_ID', 'turnOn')
129
139
  ```
130
140
 
131
- ### Logging
141
+ ### Core Methods
142
+
143
+ | Method | Description |
144
+ | :-- | :-- |
145
+ | `getDevices()` | Fetch cloud devices |
146
+ | `getStatus(deviceId)` | Fetch device status |
147
+ | `sendCommand(deviceId, command, parameter?)` | Send a raw OpenAPI command |
148
+ | `getScenes()` | Fetch scenes |
149
+ | `executeScene(sceneId)` | Run a scene |
150
+
151
+ ### Webhook Methods
152
+
153
+ | Method | Description |
154
+ | :-- | :-- |
155
+ | `setupWebhook(config)` | Register a webhook |
156
+ | `queryWebhook(urls?)` | Query existing webhook configuration |
157
+ | `updateWebhook(config)` | Update a webhook |
158
+ | `deleteWebhook(url)` | Remove a webhook |
159
+
160
+ ### Convenience Methods
132
161
 
133
- To be able to receive logging that this module is pushing out you will need to subscribt to the events.
162
+ The client also exposes convenience wrappers for common device families, including Bot and Curtain helpers.
163
+
164
+ Examples:
165
+
166
+ - `botPress(deviceId)`
167
+ - `botTurnOn(deviceId)`
168
+ - `botTurnOff(deviceId)`
169
+ - `curtainOpen(deviceId, speed?)`
170
+ - `curtainClose(deviceId, speed?)`
171
+ - `curtainPause(deviceId)`
172
+ - `curtainSetPosition(deviceId, position, speed?)`
173
+
174
+ ## Logging
175
+
176
+ In v4, logging is configured through the unified constructor rather than through a legacy event-emitter API shown in older docs.
177
+
178
+ Example using the main `SwitchBot` class:
134
179
 
135
180
  ```typescript
136
- this.switchBotAPI.on('log', (log) => {
137
- switch (log.level) {
138
- case LogLevel.SUCCESS:
139
- this.successLog(log.message)
140
- break
141
- case LogLevel.DEBUGSUCCESS:
142
- this.debugSuccessLog(log.message)
143
- break
144
- case LogLevel.WARN:
145
- this.warnLog(log.message)
146
- break
147
- case LogLevel.DEBUGWARN:
148
- this.debugWarnLog(log.message)
149
- break
150
- case LogLevel.ERROR:
151
- this.errorLog(log.message)
152
- break
153
- case LogLevel.DEBUGERROR:
154
- this.debugErrorLog(log.message)
155
- break
156
- case LogLevel.DEBUG:
157
- this.debugLog(log.message)
158
- break
159
- case LogLevel.INFO:
160
- default:
161
- this.infoLog(log.message)
162
- }
181
+ const switchbot = new SwitchBot({
182
+ token: 'YOUR_TOKEN',
183
+ secret: 'YOUR_SECRET',
184
+ enableBLE: false,
185
+ logger: {
186
+ error: console.error,
187
+ warn: console.warn,
188
+ info: console.info,
189
+ debug: console.debug,
190
+ },
163
191
  })
164
192
  ```
165
193
 
166
- ### Supported Devices
194
+ ## OpenAPI-Supported Device Families
195
+
196
+ OpenAPI support generally includes the major SwitchBot cloud-connected device families, such as:
197
+
198
+ - Bot
199
+ - Curtain and Roller Shade
200
+ - Meter family
201
+ - Contact and motion or presence sensors
202
+ - Plug Mini family
203
+ - Lock family
204
+ - Humidifier and air purifier family
205
+ - Bulb and strip light family
206
+ - Hub-connected devices supported by the SwitchBot cloud
207
+
208
+ Actual availability depends on SwitchBot cloud support for the device and whether cloud service is enabled in your account.
209
+
210
+ ## Relationship to BLE
167
211
 
168
- The following devices are supported.
212
+ OpenAPI docs are no longer separate from the main product model. In v4:
169
213
 
170
- | Device | OpenAPI Support | Webhook Support |
171
- | ---------------------------------------------- | --------------- | --------------- |
172
- | SwitchBot Bot | Yes | Yes |
173
- | SwitchBot Curtain | Yes | Yes |
174
- | SwitchBot Meter | Yes | Yes |
175
- | SwitchBot Motion Sensor | Yes | Yes |
176
- | SwitchBot Contact Sensor | Yes | Yes |
177
- | SwitchBot Plug Min | Yes | Yes |
178
- | SwitchBot Smart Lock | Yes | Yes |
179
- | SwitchBot Humidifier | Yes | Yes |
180
- | SwitchBot Evaporative Humidifier (Auto-refill) | Yes | Yes |
181
- | SwitchBot Color Bulb | Yes | Yes |
182
- | SwitchBot LED Strip Light | Yes | Yes |
214
+ - Use [BLE.md](BLE.md) for platform-specific BLE prerequisites and low-level BLE helpers
215
+ - Use this document for cloud API behavior and `OpenAPIClient`
216
+ - Use the main README for the high-level v4 migration and quick-start path
183
217
 
184
- ### Summary
218
+ ## Summary
185
219
 
186
- The `SwitchBotOpenAPI` class provides a powerful way to interact with your SwitchBot devices programmatically. By following the examples provided, you can easily integrate SwitchBot device control and monitoring into your applications.
220
+ Use `SwitchBot` for most v4 applications. Use `OpenAPIClient` only when you want direct cloud API access without the device abstraction and hybrid connection logic.
package/README.md CHANGED
@@ -91,7 +91,7 @@ const meterStatus = await meter.getStatus()
91
91
  console.log(meterStatus.temperature, meterStatus.humidity)
92
92
  ```
93
93
 
94
- See the [`examples/`](examples/) directory for more usage patterns.
94
+ See the [examples directory](https://github.com/OpenWonderLabs/node-switchbot/tree/latest/examples) for more usage patterns.
95
95
 
96
96
  ---
97
97
 
package/dist/ble.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { Buffer } from 'node:buffer';
2
1
  import type { BLEAdvertisement, BLEScanOptions } from './types/ble.js';
2
+ import { Buffer } from 'node:buffer';
3
3
  import { EventEmitter } from 'node:events';
4
+ import { Logger } from './utils/index.js';
4
5
  /**
5
6
  * BLE Scanner for discovering SwitchBot devices
6
7
  */
@@ -83,11 +84,19 @@ export declare class BLEConnection {
83
84
  private disconnectTimers;
84
85
  private operationLocks;
85
86
  private encryptionConfig;
87
+ private notificationHandlers;
86
88
  private persistentConnectionMs;
87
89
  private noblePromise;
90
+ private notificationFutures;
91
+ private expectedDisconnects;
92
+ /**
93
+ * Mark the next disconnect for this MAC as expected
94
+ */
95
+ markExpectedDisconnect(mac: string): void;
88
96
  constructor(options?: {
89
97
  noble?: any;
90
98
  logLevel?: number;
99
+ logger?: Logger;
91
100
  });
92
101
  /**
93
102
  * Initialize Noble lazily
@@ -110,7 +119,11 @@ export declare class BLEConnection {
110
119
  expectResponse?: boolean;
111
120
  validateResponse?: boolean;
112
121
  responseTimeoutMs?: number;
122
+ expectNotification?: boolean;
123
+ notificationTimeoutMs?: number;
113
124
  }): Promise<Buffer | undefined>;
125
+ subscribeNotifications(mac: string, handler: (payload: Buffer) => void): Promise<void>;
126
+ unsubscribeNotifications(mac: string, handler: (payload: Buffer) => void): void;
114
127
  /**
115
128
  * Connect to a device
116
129
  */
package/dist/ble.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ble.d.ts","sourceRoot":"","sources":["../src/ble.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAkB,MAAM,gBAAgB,CAAA;AAGtF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM1C;;GAEG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,iBAAiB,CAA2C;IACpE,OAAO,CAAC,oBAAoB,CAAiC;IAC7D,OAAO,CAAC,iBAAiB,CAAC,CAAyB;IACnD,OAAO,CAAC,oBAAoB,CAAC,CAA2B;IACxD,OAAO,CAAC,qBAAqB,CAAC,CAAY;IAC1C,OAAO,CAAC,oBAAoB,CAAC,CAAY;IACzC,OAAO,CAAC,YAAY,CAA4B;gBAEpC,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO;IAc5D;;OAEG;YACW,eAAe;IA4B7B;;OAEG;YACW,WAAW;IAUzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAoC1B;;OAEG;IACH,OAAO,CAAC,mBAAmB;I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