node-switchbot 4.0.0-beta.8 → 4.0.0

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 (418) hide show
  1. package/BLE.md +215 -838
  2. package/CHANGELOG.md +96 -1371
  3. package/OpenAPI.md +169 -135
  4. package/README.md +1 -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 +33 -1
  10. package/dist/ble.d.ts.map +1 -1
  11. package/dist/ble.js +415 -37
  12. package/dist/ble.js.map +1 -1
  13. package/dist/devices/base.d.ts +100 -1
  14. package/dist/devices/base.d.ts.map +1 -1
  15. package/dist/devices/base.js +248 -11
  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 +36 -0
  22. package/dist/devices/index.d.ts.map +1 -1
  23. package/dist/devices/index.js +36 -0
  24. package/dist/devices/index.js.map +1 -1
  25. package/dist/devices/sequence-device.d.ts +52 -0
  26. package/dist/devices/sequence-device.d.ts.map +1 -0
  27. package/dist/devices/sequence-device.js +91 -0
  28. package/dist/devices/sequence-device.js.map +1 -0
  29. package/dist/devices/wo-ai-hub.d.ts +9 -0
  30. package/dist/devices/wo-ai-hub.d.ts.map +1 -0
  31. package/dist/devices/wo-ai-hub.js +25 -0
  32. package/dist/devices/wo-ai-hub.js.map +1 -0
  33. package/dist/devices/wo-air-purifier-pm25.d.ts +29 -0
  34. package/dist/devices/wo-air-purifier-pm25.d.ts.map +1 -0
  35. package/dist/devices/wo-air-purifier-pm25.js +144 -0
  36. package/dist/devices/wo-air-purifier-pm25.js.map +1 -0
  37. package/dist/devices/wo-air-purifier.d.ts +21 -4
  38. package/dist/devices/wo-air-purifier.d.ts.map +1 -1
  39. package/dist/devices/wo-air-purifier.js +111 -61
  40. package/dist/devices/wo-air-purifier.js.map +1 -1
  41. package/dist/devices/wo-art-frame.d.ts +8 -0
  42. package/dist/devices/wo-art-frame.d.ts.map +1 -0
  43. package/dist/devices/wo-art-frame.js +12 -0
  44. package/dist/devices/wo-art-frame.js.map +1 -0
  45. package/dist/devices/wo-blind-tilt.d.ts +2 -16
  46. package/dist/devices/wo-blind-tilt.d.ts.map +1 -1
  47. package/dist/devices/wo-blind-tilt.js +135 -62
  48. package/dist/devices/wo-blind-tilt.js.map +1 -1
  49. package/dist/devices/wo-bulb.d.ts +37 -1
  50. package/dist/devices/wo-bulb.d.ts.map +1 -1
  51. package/dist/devices/wo-bulb.js +196 -51
  52. package/dist/devices/wo-bulb.js.map +1 -1
  53. package/dist/devices/wo-candle-warmer-lamp.d.ts +25 -0
  54. package/dist/devices/wo-candle-warmer-lamp.d.ts.map +1 -0
  55. package/dist/devices/wo-candle-warmer-lamp.js +81 -0
  56. package/dist/devices/wo-candle-warmer-lamp.js.map +1 -0
  57. package/dist/devices/wo-circulator-fan.d.ts +8 -0
  58. package/dist/devices/wo-circulator-fan.d.ts.map +1 -0
  59. package/dist/devices/wo-circulator-fan.js +12 -0
  60. package/dist/devices/wo-circulator-fan.js.map +1 -0
  61. package/dist/devices/wo-climate-panel.d.ts +8 -0
  62. package/dist/devices/wo-climate-panel.d.ts.map +1 -0
  63. package/dist/devices/wo-climate-panel.js +12 -0
  64. package/dist/devices/wo-climate-panel.js.map +1 -0
  65. package/dist/devices/wo-contact.d.ts +1 -1
  66. package/dist/devices/wo-contact.d.ts.map +1 -1
  67. package/dist/devices/wo-contact.js +19 -35
  68. package/dist/devices/wo-contact.js.map +1 -1
  69. package/dist/devices/wo-curtain.d.ts +20 -4
  70. package/dist/devices/wo-curtain.d.ts.map +1 -1
  71. package/dist/devices/wo-curtain.js +130 -35
  72. package/dist/devices/wo-curtain.js.map +1 -1
  73. package/dist/devices/wo-floor-lamp.d.ts +8 -0
  74. package/dist/devices/wo-floor-lamp.d.ts.map +1 -0
  75. package/dist/devices/wo-floor-lamp.js +12 -0
  76. package/dist/devices/wo-floor-lamp.js.map +1 -0
  77. package/dist/devices/wo-garage-door-opener.d.ts +8 -0
  78. package/dist/devices/wo-garage-door-opener.d.ts.map +1 -0
  79. package/dist/devices/wo-garage-door-opener.js +12 -0
  80. package/dist/devices/wo-garage-door-opener.js.map +1 -0
  81. package/dist/devices/wo-hand.d.ts +22 -6
  82. package/dist/devices/wo-hand.d.ts.map +1 -1
  83. package/dist/devices/wo-hand.js +55 -39
  84. package/dist/devices/wo-hand.js.map +1 -1
  85. package/dist/devices/wo-hub2.d.ts +1 -1
  86. package/dist/devices/wo-hub2.d.ts.map +1 -1
  87. package/dist/devices/wo-hub2.js +17 -33
  88. package/dist/devices/wo-hub2.js.map +1 -1
  89. package/dist/devices/wo-hubmini-matter.d.ts +8 -0
  90. package/dist/devices/wo-hubmini-matter.d.ts.map +1 -0
  91. package/dist/devices/wo-hubmini-matter.js +12 -0
  92. package/dist/devices/wo-hubmini-matter.js.map +1 -0
  93. package/dist/devices/wo-humi.d.ts +18 -2
  94. package/dist/devices/wo-humi.d.ts.map +1 -1
  95. package/dist/devices/wo-humi.js +60 -36
  96. package/dist/devices/wo-humi.js.map +1 -1
  97. package/dist/devices/wo-humi2.d.ts.map +1 -1
  98. package/dist/devices/wo-humi2.js.map +1 -1
  99. package/dist/devices/wo-keypad-vision-pro.d.ts +18 -0
  100. package/dist/devices/wo-keypad-vision-pro.d.ts.map +1 -0
  101. package/dist/devices/wo-keypad-vision-pro.js +15 -0
  102. package/dist/devices/wo-keypad-vision-pro.js.map +1 -0
  103. package/dist/devices/wo-keypad-vision.d.ts +8 -0
  104. package/dist/devices/wo-keypad-vision.d.ts.map +1 -0
  105. package/dist/devices/wo-keypad-vision.js +12 -0
  106. package/dist/devices/wo-keypad-vision.js.map +1 -0
  107. package/dist/devices/wo-keypad.d.ts +1 -1
  108. package/dist/devices/wo-keypad.d.ts.map +1 -1
  109. package/dist/devices/wo-keypad.js +14 -30
  110. package/dist/devices/wo-keypad.js.map +1 -1
  111. package/dist/devices/wo-leak.d.ts +1 -1
  112. package/dist/devices/wo-leak.d.ts.map +1 -1
  113. package/dist/devices/wo-leak.js +15 -31
  114. package/dist/devices/wo-leak.js.map +1 -1
  115. package/dist/devices/wo-lock-lite.d.ts +7 -0
  116. package/dist/devices/wo-lock-lite.d.ts.map +1 -0
  117. package/dist/devices/wo-lock-lite.js +11 -0
  118. package/dist/devices/wo-lock-lite.js.map +1 -0
  119. package/dist/devices/wo-lock-pro-wifi.d.ts +7 -0
  120. package/dist/devices/wo-lock-pro-wifi.d.ts.map +1 -0
  121. package/dist/devices/wo-lock-pro-wifi.js +11 -0
  122. package/dist/devices/wo-lock-pro-wifi.js.map +1 -0
  123. package/dist/devices/wo-lock-pro.d.ts +12 -3
  124. package/dist/devices/wo-lock-pro.d.ts.map +1 -1
  125. package/dist/devices/wo-lock-pro.js +83 -37
  126. package/dist/devices/wo-lock-pro.js.map +1 -1
  127. package/dist/devices/wo-lock-vision-pro.d.ts +7 -0
  128. package/dist/devices/wo-lock-vision-pro.d.ts.map +1 -0
  129. package/dist/devices/wo-lock-vision-pro.js +11 -0
  130. package/dist/devices/wo-lock-vision-pro.js.map +1 -0
  131. package/dist/devices/wo-lock-vision.d.ts +7 -0
  132. package/dist/devices/wo-lock-vision.d.ts.map +1 -0
  133. package/dist/devices/wo-lock-vision.js +11 -0
  134. package/dist/devices/wo-lock-vision.js.map +1 -0
  135. package/dist/devices/wo-lock.d.ts +8 -3
  136. package/dist/devices/wo-lock.d.ts.map +1 -1
  137. package/dist/devices/wo-lock.js +75 -36
  138. package/dist/devices/wo-lock.js.map +1 -1
  139. package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts +21 -0
  140. package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts.map +1 -0
  141. package/dist/devices/wo-pan-tilt-cam-plus-3k.js +87 -0
  142. package/dist/devices/wo-pan-tilt-cam-plus-3k.js.map +1 -0
  143. package/dist/devices/wo-plug-mini-us.d.ts +3 -3
  144. package/dist/devices/wo-plug-mini-us.d.ts.map +1 -1
  145. package/dist/devices/wo-plug-mini-us.js +25 -35
  146. package/dist/devices/wo-plug-mini-us.js.map +1 -1
  147. package/dist/devices/wo-presence.d.ts +1 -1
  148. package/dist/devices/wo-presence.d.ts.map +1 -1
  149. package/dist/devices/wo-presence.js +17 -33
  150. package/dist/devices/wo-presence.js.map +1 -1
  151. package/dist/devices/wo-relay-switch-1.d.ts +19 -3
  152. package/dist/devices/wo-relay-switch-1.d.ts.map +1 -1
  153. package/dist/devices/wo-relay-switch-1.js +90 -42
  154. package/dist/devices/wo-relay-switch-1.js.map +1 -1
  155. package/dist/devices/wo-relay-switch-2pm.d.ts +21 -0
  156. package/dist/devices/wo-relay-switch-2pm.d.ts.map +1 -0
  157. package/dist/devices/wo-relay-switch-2pm.js +37 -0
  158. package/dist/devices/wo-relay-switch-2pm.js.map +1 -0
  159. package/dist/devices/wo-remote-with-screen.d.ts +9 -0
  160. package/dist/devices/wo-remote-with-screen.d.ts.map +1 -0
  161. package/dist/devices/wo-remote-with-screen.js +22 -0
  162. package/dist/devices/wo-remote-with-screen.js.map +1 -0
  163. package/dist/devices/wo-remote.d.ts +1 -1
  164. package/dist/devices/wo-remote.d.ts.map +1 -1
  165. package/dist/devices/wo-remote.js +13 -29
  166. package/dist/devices/wo-remote.js.map +1 -1
  167. package/dist/devices/wo-rgbic-bulb.d.ts +29 -0
  168. package/dist/devices/wo-rgbic-bulb.d.ts.map +1 -0
  169. package/dist/devices/wo-rgbic-bulb.js +84 -0
  170. package/dist/devices/wo-rgbic-bulb.js.map +1 -0
  171. package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts +29 -0
  172. package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts.map +1 -0
  173. package/dist/devices/wo-rgbic-neon-wire-rope-light.js +113 -0
  174. package/dist/devices/wo-rgbic-neon-wire-rope-light.js.map +1 -0
  175. package/dist/devices/wo-rgbicww-floor-lamp.d.ts +8 -0
  176. package/dist/devices/wo-rgbicww-floor-lamp.d.ts.map +1 -0
  177. package/dist/devices/wo-rgbicww-floor-lamp.js +12 -0
  178. package/dist/devices/wo-rgbicww-floor-lamp.js.map +1 -0
  179. package/dist/devices/wo-rgbicww-strip-light.d.ts +8 -0
  180. package/dist/devices/wo-rgbicww-strip-light.d.ts.map +1 -0
  181. package/dist/devices/wo-rgbicww-strip-light.js +12 -0
  182. package/dist/devices/wo-rgbicww-strip-light.js.map +1 -0
  183. package/dist/devices/wo-roller-shade.d.ts +8 -0
  184. package/dist/devices/wo-roller-shade.d.ts.map +1 -0
  185. package/dist/devices/wo-roller-shade.js +12 -0
  186. package/dist/devices/wo-roller-shade.js.map +1 -0
  187. package/dist/devices/wo-sensor-th.d.ts +1 -1
  188. package/dist/devices/wo-sensor-th.d.ts.map +1 -1
  189. package/dist/devices/wo-sensor-th.js +18 -34
  190. package/dist/devices/wo-sensor-th.js.map +1 -1
  191. package/dist/devices/wo-smart-thermostat-radiator.d.ts +8 -0
  192. package/dist/devices/wo-smart-thermostat-radiator.d.ts.map +1 -0
  193. package/dist/devices/wo-smart-thermostat-radiator.js +12 -0
  194. package/dist/devices/wo-smart-thermostat-radiator.js.map +1 -0
  195. package/dist/devices/wo-strip-light-3.d.ts +8 -0
  196. package/dist/devices/wo-strip-light-3.d.ts.map +1 -0
  197. package/dist/devices/wo-strip-light-3.js +12 -0
  198. package/dist/devices/wo-strip-light-3.js.map +1 -0
  199. package/dist/devices/wo-vacuum-k10-plus.d.ts +7 -0
  200. package/dist/devices/wo-vacuum-k10-plus.d.ts.map +1 -0
  201. package/dist/devices/wo-vacuum-k10-plus.js +11 -0
  202. package/dist/devices/wo-vacuum-k10-plus.js.map +1 -0
  203. package/dist/devices/wo-vacuum-k10-pro-combo.d.ts +7 -0
  204. package/dist/devices/wo-vacuum-k10-pro-combo.d.ts.map +1 -0
  205. package/dist/devices/wo-vacuum-k10-pro-combo.js +11 -0
  206. package/dist/devices/wo-vacuum-k10-pro-combo.js.map +1 -0
  207. package/dist/devices/wo-vacuum-k10-pro.d.ts +7 -0
  208. package/dist/devices/wo-vacuum-k10-pro.d.ts.map +1 -0
  209. package/dist/devices/wo-vacuum-k10-pro.js +11 -0
  210. package/dist/devices/wo-vacuum-k10-pro.js.map +1 -0
  211. package/dist/devices/wo-vacuum-k11-plus.d.ts +7 -0
  212. package/dist/devices/wo-vacuum-k11-plus.d.ts.map +1 -0
  213. package/dist/devices/wo-vacuum-k11-plus.js +11 -0
  214. package/dist/devices/wo-vacuum-k11-plus.js.map +1 -0
  215. package/dist/devices/wo-vacuum-k20.d.ts +7 -0
  216. package/dist/devices/wo-vacuum-k20.d.ts.map +1 -0
  217. package/dist/devices/wo-vacuum-k20.js +11 -0
  218. package/dist/devices/wo-vacuum-k20.js.map +1 -0
  219. package/dist/devices/wo-vacuum-s10.d.ts +7 -0
  220. package/dist/devices/wo-vacuum-s10.d.ts.map +1 -0
  221. package/dist/devices/wo-vacuum-s10.js +11 -0
  222. package/dist/devices/wo-vacuum-s10.js.map +1 -0
  223. package/dist/devices/wo-vacuum-s20.d.ts +7 -0
  224. package/dist/devices/wo-vacuum-s20.d.ts.map +1 -0
  225. package/dist/devices/wo-vacuum-s20.js +11 -0
  226. package/dist/devices/wo-vacuum-s20.js.map +1 -0
  227. package/dist/devices/wo-vacuum.d.ts +44 -0
  228. package/dist/devices/wo-vacuum.d.ts.map +1 -0
  229. package/dist/devices/wo-vacuum.js +143 -0
  230. package/dist/devices/wo-vacuum.js.map +1 -0
  231. package/dist/devices/wo-water-detector.d.ts +9 -0
  232. package/dist/devices/wo-water-detector.d.ts.map +1 -0
  233. package/dist/devices/wo-water-detector.js +20 -0
  234. package/dist/devices/wo-water-detector.js.map +1 -0
  235. package/dist/errors.d.ts +20 -0
  236. package/dist/errors.d.ts.map +1 -1
  237. package/dist/errors.js +31 -1
  238. package/dist/errors.js.map +1 -1
  239. package/dist/index.d.ts +4 -2
  240. package/dist/index.d.ts.map +1 -1
  241. package/dist/index.js +3 -1
  242. package/dist/index.js.map +1 -1
  243. package/dist/settings.d.ts +25 -0
  244. package/dist/settings.d.ts.map +1 -1
  245. package/dist/settings.js +85 -6
  246. package/dist/settings.js.map +1 -1
  247. package/dist/switchbot.d.ts +1 -0
  248. package/dist/switchbot.d.ts.map +1 -1
  249. package/dist/switchbot.js +154 -34
  250. package/dist/switchbot.js.map +1 -1
  251. package/dist/types/ble.d.ts +24 -0
  252. package/dist/types/ble.d.ts.map +1 -1
  253. package/dist/types/ble.js.map +1 -1
  254. package/dist/types/device.d.ts +84 -5
  255. package/dist/types/device.d.ts.map +1 -1
  256. package/dist/types/index.d.ts +26 -0
  257. package/dist/types/index.d.ts.map +1 -1
  258. package/dist/types/index.js.map +1 -1
  259. package/dist/utils/fallback-handler.js +0 -1
  260. package/dist/utils/fallback-handler.js.map +1 -1
  261. package/dist/utils/index.d.ts +21 -1
  262. package/dist/utils/index.d.ts.map +1 -1
  263. package/dist/utils/index.js +49 -0
  264. package/dist/utils/index.js.map +1 -1
  265. package/dist/utils/relay-encryption.d.ts +10 -0
  266. package/dist/utils/relay-encryption.d.ts.map +1 -0
  267. package/dist/utils/relay-encryption.js +23 -0
  268. package/dist/utils/relay-encryption.js.map +1 -0
  269. package/dist/utils/retry.d.ts.map +1 -1
  270. package/dist/utils/retry.js +49 -6
  271. package/dist/utils/retry.js.map +1 -1
  272. package/package.json +30 -14
  273. package/.gitattributes +0 -2
  274. package/.github/copilot-instructions.md +0 -179
  275. package/.github/dependabot.yml +0 -17
  276. package/.github/labeler.yml +0 -38
  277. package/.github/npm-version-script-esm.js +0 -97
  278. package/.github/workflows/beta-release.yml +0 -52
  279. package/.github/workflows/release.yml +0 -71
  280. package/.github/workflows/stale.yml +0 -12
  281. package/PRODUCTION_READY.md +0 -135
  282. package/branding/Node_x_SwitchBot.svg +0 -8
  283. package/branding/icon.png +0 -0
  284. package/branding/switchbot.png +0 -0
  285. package/docs/.nojekyll +0 -1
  286. package/docs/assets/hierarchy.js +0 -1
  287. package/docs/assets/highlight.css +0 -85
  288. package/docs/assets/icons.js +0 -18
  289. package/docs/assets/icons.svg +0 -1
  290. package/docs/assets/main.js +0 -60
  291. package/docs/assets/navigation.js +0 -1
  292. package/docs/assets/search.js +0 -1
  293. package/docs/assets/style.css +0 -1633
  294. package/docs/classes/APIError.html +0 -6
  295. package/docs/classes/APINotAvailableError.html +0 -4
  296. package/docs/classes/BLEConnection.html +0 -17
  297. package/docs/classes/BLENotAvailableError.html +0 -4
  298. package/docs/classes/BLEScanner.html +0 -17
  299. package/docs/classes/CommandFailedError.html +0 -6
  300. package/docs/classes/ConnectionTimeoutError.html +0 -5
  301. package/docs/classes/DeviceManager.html +0 -25
  302. package/docs/classes/DeviceNotFoundError.html +0 -4
  303. package/docs/classes/DiscoveryError.html +0 -5
  304. package/docs/classes/OpenAPIClient.html +0 -66
  305. package/docs/classes/SwitchBot.html +0 -22
  306. package/docs/classes/SwitchBotDevice.html +0 -56
  307. package/docs/classes/SwitchBotError.html +0 -4
  308. package/docs/classes/ValidationError.html +0 -5
  309. package/docs/classes/WoAirPurifier.html +0 -63
  310. package/docs/classes/WoAirPurifierTable.html +0 -64
  311. package/docs/classes/WoBlindTilt.html +0 -67
  312. package/docs/classes/WoBulb.html +0 -65
  313. package/docs/classes/WoCeilingLight.html +0 -66
  314. package/docs/classes/WoContact.html +0 -55
  315. package/docs/classes/WoCurtain.html +0 -63
  316. package/docs/classes/WoHand.html +0 -69
  317. package/docs/classes/WoHub2.html +0 -55
  318. package/docs/classes/WoHub3.html +0 -56
  319. package/docs/classes/WoHumi.html +0 -63
  320. package/docs/classes/WoHumi2.html +0 -64
  321. package/docs/classes/WoIOSensorTH.html +0 -56
  322. package/docs/classes/WoKeypad.html +0 -56
  323. package/docs/classes/WoLeak.html +0 -55
  324. package/docs/classes/WoPlugMiniJP.html +0 -62
  325. package/docs/classes/WoPlugMiniUS.html +0 -61
  326. package/docs/classes/WoPresence.html +0 -55
  327. package/docs/classes/WoRelaySwitch1.html +0 -61
  328. package/docs/classes/WoRelaySwitch1PM.html +0 -62
  329. package/docs/classes/WoRemote.html +0 -56
  330. package/docs/classes/WoSensorTH.html +0 -55
  331. package/docs/classes/WoSensorTHPlus.html +0 -56
  332. package/docs/classes/WoSensorTHPro.html +0 -56
  333. package/docs/classes/WoSensorTHProCO2.html +0 -56
  334. package/docs/classes/WoSmartLock.html +0 -59
  335. package/docs/classes/WoSmartLockPro.html +0 -61
  336. package/docs/classes/WoStrip.html +0 -66
  337. package/docs/enums/LogLevel.html +0 -7
  338. package/docs/enums/SwitchBotBLEModel.html +0 -40
  339. package/docs/enums/SwitchBotBLEModelName.html +0 -40
  340. package/docs/functions/updateBaseURL.html +0 -3
  341. package/docs/hierarchy.html +0 -1
  342. package/docs/index.html +0 -55
  343. package/docs/interfaces/APICommandRequest.html +0 -5
  344. package/docs/interfaces/APICommandResponse.html +0 -5
  345. package/docs/interfaces/APIDevice.html +0 -18
  346. package/docs/interfaces/APIDeviceStatus.html +0 -36
  347. package/docs/interfaces/APIErrorResponse.html +0 -5
  348. package/docs/interfaces/APIResponse.html +0 -5
  349. package/docs/interfaces/AirPurifierCommands.html +0 -5
  350. package/docs/interfaces/AirPurifierServiceData.html +0 -14
  351. package/docs/interfaces/AirPurifierStatus.html +0 -17
  352. package/docs/interfaces/BLEAdvertisement.html +0 -7
  353. package/docs/interfaces/BLEScanOptions.html +0 -10
  354. package/docs/interfaces/BLEServiceData.html +0 -10
  355. package/docs/interfaces/BlindTiltCommands.html +0 -7
  356. package/docs/interfaces/BlindTiltServiceData.html +0 -14
  357. package/docs/interfaces/BlindTiltStatus.html +0 -15
  358. package/docs/interfaces/BotCommands.html +0 -4
  359. package/docs/interfaces/BotServiceData.html +0 -12
  360. package/docs/interfaces/BotStatus.html +0 -14
  361. package/docs/interfaces/BulbCommands.html +0 -6
  362. package/docs/interfaces/BulbServiceData.html +0 -19
  363. package/docs/interfaces/BulbStatus.html +0 -16
  364. package/docs/interfaces/CeilingLightCommands.html +0 -6
  365. package/docs/interfaces/CeilingLightServiceData.html +0 -19
  366. package/docs/interfaces/CeilingLightStatus.html +0 -16
  367. package/docs/interfaces/CommandResult.html +0 -12
  368. package/docs/interfaces/ContactServiceData.html +0 -13
  369. package/docs/interfaces/ContactStatus.html +0 -15
  370. package/docs/interfaces/CurtainCommands.html +0 -5
  371. package/docs/interfaces/CurtainServiceData.html +0 -14
  372. package/docs/interfaces/CurtainStatus.html +0 -17
  373. package/docs/interfaces/DeviceInfo.html +0 -28
  374. package/docs/interfaces/DeviceListResponse.html +0 -4
  375. package/docs/interfaces/DeviceStatus.html +0 -12
  376. package/docs/interfaces/DiscoveryOptions.html +0 -14
  377. package/docs/interfaces/HubServiceData.html +0 -14
  378. package/docs/interfaces/HubStatus.html +0 -15
  379. package/docs/interfaces/HumidifierCommands.html +0 -5
  380. package/docs/interfaces/HumidifierServiceData.html +0 -14
  381. package/docs/interfaces/HumidifierStatus.html +0 -18
  382. package/docs/interfaces/KeypadStatus.html +0 -13
  383. package/docs/interfaces/LeakServiceData.html +0 -11
  384. package/docs/interfaces/LeakStatus.html +0 -13
  385. package/docs/interfaces/LockCommands.html +0 -3
  386. package/docs/interfaces/LockServiceData.html +0 -15
  387. package/docs/interfaces/LockStatus.html +0 -15
  388. package/docs/interfaces/MeterServiceData.html +0 -13
  389. package/docs/interfaces/MeterStatus.html +0 -15
  390. package/docs/interfaces/MotionServiceData.html +0 -13
  391. package/docs/interfaces/MotionStatus.html +0 -14
  392. package/docs/interfaces/PlugCommands.html +0 -4
  393. package/docs/interfaces/PlugServiceData.html +0 -17
  394. package/docs/interfaces/PlugStatus.html +0 -16
  395. package/docs/interfaces/PresenceServiceData.html +0 -12
  396. package/docs/interfaces/PresenceStatus.html +0 -14
  397. package/docs/interfaces/RelaySwitchCommands.html +0 -4
  398. package/docs/interfaces/RelaySwitchServiceData.html +0 -14
  399. package/docs/interfaces/RelaySwitchStatus.html +0 -16
  400. package/docs/interfaces/RemoteStatus.html +0 -12
  401. package/docs/interfaces/SceneListResponse.html +0 -3
  402. package/docs/interfaces/StripCommands.html +0 -6
  403. package/docs/interfaces/StripServiceData.html +0 -19
  404. package/docs/interfaces/StripStatus.html +0 -16
  405. package/docs/interfaces/SwitchBotConfig.html +0 -30
  406. package/docs/interfaces/WebhookConfig.html +0 -4
  407. package/docs/interfaces/WebhookDetails.html +0 -7
  408. package/docs/interfaces/WebhookQueryResponse.html +0 -5
  409. package/docs/interfaces/WebhookSetupResponse.html +0 -5
  410. package/docs/media/BLE.md +0 -1259
  411. package/docs/media/OpenAPI.md +0 -186
  412. package/docs/modules.html +0 -1
  413. package/docs/types/ConnectionType.html +0 -2
  414. package/docs/types/PhysicalDeviceType.html +0 -2
  415. package/docs/types/VirtualDeviceType.html +0 -2
  416. package/docs/variables/urls.html +0 -1
  417. package/tmp-switchbot-scan.mjs +0 -79
  418. package/tsconfig.build.json +0 -17
@@ -1 +0,0 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>urls | node-switchbot</title><meta name="description" content="Documentation for node-switchbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">node-switchbot</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">urls</a></li></ul><h1>Variable urls<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">urls</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">base</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">devices</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">scenes</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">webhook</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-type-declaration"><h4>Type Declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5 id="base"><span class="tsd-kind-property">base</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="devices"><span class="tsd-kind-property">devices</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="scenes"><span class="tsd-kind-property">scenes</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="webhook"><span class="tsd-kind-property">webhook</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li></ul></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/f817feccc138c85e1b387ae95d00b30743e9ddee/src/settings.ts#L14">settings.ts:14</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">node-switchbot</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
@@ -1,79 +0,0 @@
1
- import noble from '@stoprocent/noble'
2
-
3
- const SWITCHBOT_UUIDS = new Set(['fd3d', '0000fd3d00001000800000805f9b34fb'])
4
- const discovered = new Map()
5
-
6
- function normalizeUuid(uuid = '') {
7
- return String(uuid).toLowerCase().replace(/-/g, '')
8
- }
9
-
10
- function toHex(buf) {
11
- if (!buf) return undefined
12
- return Buffer.from(buf).toString('hex')
13
- }
14
-
15
- const timeoutMs = 12000
16
- let finished = false
17
-
18
- function done(reason = 'completed') {
19
- if (finished) return
20
- finished = true
21
-
22
- try {
23
- noble.stopScanning()
24
- } catch {}
25
-
26
- const devices = [...discovered.values()]
27
- const output = {
28
- reason,
29
- count: devices.length,
30
- devices,
31
- }
32
-
33
- console.log('\n=== SwitchBot BLE Scan Result ===')
34
- console.log(JSON.stringify(output, null, 2))
35
- process.exit(0)
36
- }
37
-
38
- noble.on('stateChange', (state) => {
39
- console.log(`[scan] stateChange: ${state}`)
40
- if (state === 'poweredOn') {
41
- try {
42
- noble.startScanning([], true)
43
- console.log('[scan] scanning started')
44
- setTimeout(() => done('scan-timeout'), timeoutMs)
45
- } catch (error) {
46
- console.error('[scan] failed to start scan', error)
47
- done('scan-start-failed')
48
- }
49
- }
50
- })
51
-
52
- noble.on('discover', (peripheral) => {
53
- const ad = peripheral?.advertisement || {}
54
- const serviceData = Array.isArray(ad.serviceData) ? ad.serviceData : []
55
- const switchbotServiceData = serviceData.filter(item => SWITCHBOT_UUIDS.has(normalizeUuid(item?.uuid)))
56
- if (!switchbotServiceData.length) {
57
- return
58
- }
59
-
60
- const key = peripheral?.id || peripheral?.address || `unknown-${discovered.size + 1}`
61
- discovered.set(key, {
62
- id: peripheral?.id,
63
- address: peripheral?.address,
64
- connectable: peripheral?.connectable,
65
- rssi: peripheral?.rssi,
66
- localName: ad.localName,
67
- serviceUuids: ad.serviceUuids,
68
- serviceData: switchbotServiceData.map(item => ({
69
- uuid: item?.uuid,
70
- dataHex: toHex(item?.data),
71
- })),
72
- manufacturerDataHex: toHex(ad.manufacturerData),
73
- })
74
- })
75
-
76
- setTimeout(() => {
77
- console.log(`[scan] timeout waiting for poweredOn state`)
78
- done('poweredOn-timeout')
79
- }, timeoutMs + 5000)
@@ -1,17 +0,0 @@
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
- }