node-switchbot 3.4.9 → 3.5.0-beta.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 (439) hide show
  1. package/.github/npm-version-script-esm.js +97 -0
  2. package/.github/workflows/beta-release.yml +1 -1
  3. package/.github/workflows/release.yml +1 -1
  4. package/dist/device.d.ts +1193 -2
  5. package/dist/device.d.ts.map +1 -1
  6. package/dist/device.js +2478 -2
  7. package/dist/device.js.map +1 -1
  8. package/dist/index.d.ts +0 -19
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +0 -19
  11. package/dist/index.js.map +1 -1
  12. package/dist/{test/index.test.d.ts.map → index.test.d.ts.map} +1 -1
  13. package/dist/{test/index.test.js → index.test.js} +1 -1
  14. package/dist/index.test.js.map +1 -0
  15. package/dist/parameter-checker.d.ts +1 -1
  16. package/dist/parameter-checker.d.ts.map +1 -1
  17. package/dist/{test/settings.test.d.ts.map → settings.test.d.ts.map} +1 -1
  18. package/dist/{test/settings.test.js → settings.test.js} +1 -1
  19. package/dist/settings.test.js.map +1 -0
  20. package/dist/switchbot-ble.d.ts +1 -1
  21. package/dist/switchbot-ble.d.ts.map +1 -1
  22. package/dist/switchbot-ble.js +2 -27
  23. package/dist/switchbot-ble.js.map +1 -1
  24. package/dist/switchbot-openapi.d.ts.map +1 -1
  25. package/dist/switchbot-openapi.js +3 -2
  26. package/dist/switchbot-openapi.js.map +1 -1
  27. package/dist/types/bledevicestatus.d.ts +16 -1
  28. package/dist/types/bledevicestatus.d.ts.map +1 -1
  29. package/dist/types/types.d.ts +0 -232
  30. package/dist/types/types.d.ts.map +1 -1
  31. package/dist/types/types.js +1 -153
  32. package/dist/types/types.js.map +1 -1
  33. package/docs/assets/hierarchy.js +1 -1
  34. package/docs/assets/navigation.js +1 -1
  35. package/docs/assets/search.js +1 -1
  36. package/docs/classes/Advertising.html +4 -4
  37. package/docs/classes/SwitchBotBLE.html +8 -8
  38. package/docs/classes/SwitchBotOpenAPI.html +7 -7
  39. package/docs/classes/SwitchbotDevice.html +14 -11
  40. package/docs/classes/WoBlindTilt.html +23 -20
  41. package/docs/classes/WoBulb.html +21 -18
  42. package/docs/classes/WoCeilingLight.html +24 -21
  43. package/docs/classes/WoContact.html +15 -12
  44. package/docs/classes/WoCurtain.html +20 -17
  45. package/docs/classes/WoHand.html +20 -17
  46. package/docs/classes/WoHub2.html +15 -12
  47. package/docs/classes/WoHumi.html +22 -19
  48. package/docs/classes/WoHumi2.html +67 -0
  49. package/docs/classes/WoIOSensorTH.html +15 -12
  50. package/docs/classes/WoKeypad.html +52 -0
  51. package/docs/classes/WoLeak.html +53 -0
  52. package/docs/classes/WoPlugMiniJP.html +78 -0
  53. package/docs/classes/WoPlugMiniUS.html +20 -17
  54. package/docs/classes/WoPresence.html +15 -12
  55. package/docs/classes/WoRelaySwitch1.html +17 -14
  56. package/docs/classes/WoRelaySwitch1PM.html +17 -14
  57. package/docs/classes/WoRemote.html +52 -0
  58. package/docs/classes/WoSensorTH.html +14 -11
  59. package/docs/classes/WoSensorTHPlus.html +46 -0
  60. package/docs/classes/WoSensorTHPro.html +46 -0
  61. package/docs/classes/WoSensorTHProCO2.html +46 -0
  62. package/docs/classes/WoSmartLock.html +25 -22
  63. package/docs/classes/WoSmartLockPro.html +25 -22
  64. package/docs/classes/WoStrip.html +22 -19
  65. package/docs/enums/LogLevel.html +2 -2
  66. package/docs/enums/SwitchBotBLEModel.html +3 -2
  67. package/docs/enums/SwitchBotBLEModelFriendlyName.html +3 -2
  68. package/docs/enums/SwitchBotBLEModelName.html +3 -2
  69. package/docs/enums/SwitchBotModel.html +2 -2
  70. package/docs/hierarchy.html +1 -1
  71. package/docs/interfaces/AdvertisementData.html +2 -2
  72. package/docs/interfaces/Chars.html +2 -2
  73. package/docs/interfaces/ErrorObject.html +2 -2
  74. package/docs/interfaces/NobleTypes.html +2 -2
  75. package/docs/interfaces/Params.html +2 -2
  76. package/docs/interfaces/Rule.html +2 -2
  77. package/docs/interfaces/ServiceData.html +2 -2
  78. package/docs/interfaces/SwitchBotBLEDevice.html +2 -2
  79. package/docs/interfaces/WebhookDetail.html +2 -2
  80. package/docs/interfaces/ad.html +2 -2
  81. package/docs/interfaces/body.html +2 -2
  82. package/docs/interfaces/bodyChange.html +2 -2
  83. package/docs/interfaces/deleteWebhookResponse.html +2 -2
  84. package/docs/interfaces/device.html +2 -2
  85. package/docs/interfaces/deviceList.html +2 -2
  86. package/docs/interfaces/deviceStatus.html +2 -2
  87. package/docs/interfaces/deviceStatusRequest.html +2 -2
  88. package/docs/interfaces/deviceWebhook.html +2 -2
  89. package/docs/interfaces/deviceWebhookContext.html +2 -2
  90. package/docs/interfaces/devices.html +2 -2
  91. package/docs/interfaces/infraredRemoteList.html +2 -2
  92. package/docs/interfaces/irdevice.html +2 -2
  93. package/docs/interfaces/pushResponse.html +2 -2
  94. package/docs/interfaces/queryWebhookResponse.html +2 -2
  95. package/docs/interfaces/setupWebhookResponse.html +2 -2
  96. package/docs/interfaces/switchbot.html +2 -2
  97. package/docs/interfaces/updateWebhookResponse.html +2 -2
  98. package/docs/interfaces/webhookRequest.html +2 -2
  99. package/docs/modules.html +1 -1
  100. package/docs/types/MacAddress.html +1 -1
  101. package/docs/types/batteryCirculatorFan.html +1 -1
  102. package/docs/types/batteryCirculatorFanServiceData.html +1 -1
  103. package/docs/types/batteryCirculatorFanStatus.html +1 -1
  104. package/docs/types/batteryCirculatorFanWebhookContext.html +1 -1
  105. package/docs/types/blindTilt.html +1 -1
  106. package/docs/types/blindTiltServiceData.html +1 -1
  107. package/docs/types/blindTiltStatus.html +1 -1
  108. package/docs/types/blindTiltWebhookContext.html +1 -1
  109. package/docs/types/bot.html +1 -1
  110. package/docs/types/botServiceData.html +1 -1
  111. package/docs/types/botStatus.html +1 -1
  112. package/docs/types/botWebhookContext.html +1 -1
  113. package/docs/types/ceilingLight.html +1 -1
  114. package/docs/types/ceilingLightPro.html +1 -1
  115. package/docs/types/ceilingLightProServiceData.html +1 -1
  116. package/docs/types/ceilingLightProStatus.html +1 -1
  117. package/docs/types/ceilingLightProWebhookContext.html +1 -1
  118. package/docs/types/ceilingLightServiceData.html +1 -1
  119. package/docs/types/ceilingLightStatus.html +1 -1
  120. package/docs/types/ceilingLightWebhookContext.html +1 -1
  121. package/docs/types/circulatorFanStatus.html +1 -1
  122. package/docs/types/circulatorFanWebhookContext.html +1 -1
  123. package/docs/types/colorBulb.html +1 -1
  124. package/docs/types/colorBulbServiceData.html +1 -1
  125. package/docs/types/colorBulbStatus.html +1 -1
  126. package/docs/types/colorBulbWebhookContext.html +1 -1
  127. package/docs/types/contactSensor.html +1 -1
  128. package/docs/types/contactSensorServiceData.html +1 -1
  129. package/docs/types/contactSensorStatus.html +1 -1
  130. package/docs/types/contactSensorWebhookContext.html +1 -1
  131. package/docs/types/curtain.html +1 -1
  132. package/docs/types/curtain3.html +1 -1
  133. package/docs/types/curtain3ServiceData.html +1 -1
  134. package/docs/types/curtain3WebhookContext.html +1 -1
  135. package/docs/types/curtainServiceData.html +1 -1
  136. package/docs/types/curtainStatus.html +1 -1
  137. package/docs/types/curtainWebhookContext.html +1 -1
  138. package/docs/types/floorCleaningRobotS10.html +1 -1
  139. package/docs/types/floorCleaningRobotS10Status.html +1 -1
  140. package/docs/types/floorCleaningRobotS10WebhookContext.html +1 -1
  141. package/docs/types/hub2.html +1 -1
  142. package/docs/types/hub2ServiceData.html +1 -1
  143. package/docs/types/hub2Status.html +1 -1
  144. package/docs/types/hub2WebhookContext.html +1 -1
  145. package/docs/types/humidifier.html +1 -1
  146. package/docs/types/humidifier2ServiceData.html +1 -1
  147. package/docs/types/humidifier2Status.html +1 -1
  148. package/docs/types/humidifier2WebhookContext.html +1 -1
  149. package/docs/types/humidifierServiceData.html +1 -1
  150. package/docs/types/humidifierStatus.html +1 -1
  151. package/docs/types/humidifierWebhookContext.html +1 -1
  152. package/docs/types/indoorCam.html +1 -1
  153. package/docs/types/indoorCameraWebhookContext.html +1 -1
  154. package/docs/types/keypad.html +1 -1
  155. package/docs/types/keypadDetectorServiceData.html +1 -1
  156. package/docs/types/keypadTouch.html +1 -1
  157. package/docs/types/keypadTouchWebhookContext.html +1 -1
  158. package/docs/types/keypadWebhookContext.html +1 -1
  159. package/docs/types/lock.html +1 -1
  160. package/docs/types/lockPro.html +1 -1
  161. package/docs/types/lockProServiceData.html +1 -1
  162. package/docs/types/lockProStatus.html +1 -1
  163. package/docs/types/lockProWebhookContext.html +1 -1
  164. package/docs/types/lockServiceData.html +1 -1
  165. package/docs/types/lockStatus.html +1 -1
  166. package/docs/types/lockWebhookContext.html +1 -1
  167. package/docs/types/meter.html +1 -1
  168. package/docs/types/meterPlus.html +1 -1
  169. package/docs/types/meterPlusServiceData.html +1 -1
  170. package/docs/types/meterPlusStatus.html +1 -1
  171. package/docs/types/meterPlusWebhookContext.html +1 -1
  172. package/docs/types/meterPro.html +1 -1
  173. package/docs/types/meterProCO2ServiceData.html +1 -1
  174. package/docs/types/meterProCO2Status.html +1 -1
  175. package/docs/types/meterProCO2WebhookContext.html +1 -1
  176. package/docs/types/meterProServiceData.html +1 -1
  177. package/docs/types/meterProStatus.html +1 -1
  178. package/docs/types/meterProWebhookContext.html +1 -1
  179. package/docs/types/meterServiceData.html +1 -1
  180. package/docs/types/meterStatus.html +1 -1
  181. package/docs/types/meterWebhookContext.html +1 -1
  182. package/docs/types/motionSensor.html +1 -1
  183. package/docs/types/motionSensorServiceData.html +1 -1
  184. package/docs/types/motionSensorStatus.html +1 -1
  185. package/docs/types/motionSensorWebhookContext.html +1 -1
  186. package/docs/types/onadvertisement.html +1 -1
  187. package/docs/types/ondiscover.html +1 -1
  188. package/docs/types/outdoorMeter.html +1 -1
  189. package/docs/types/outdoorMeterServiceData.html +1 -1
  190. package/docs/types/outdoorMeterStatus.html +1 -1
  191. package/docs/types/outdoorMeterWebhookContext.html +1 -1
  192. package/docs/types/panTiltCamWebhookContext.html +1 -1
  193. package/docs/types/pantiltCam.html +1 -1
  194. package/docs/types/pantiltCam2k.html +1 -1
  195. package/docs/types/plug.html +1 -1
  196. package/docs/types/plugMini.html +1 -1
  197. package/docs/types/plugMiniJPServiceData.html +1 -1
  198. package/docs/types/plugMiniJPWebhookContext.html +1 -1
  199. package/docs/types/plugMiniStatus.html +1 -1
  200. package/docs/types/plugMiniUSServiceData.html +1 -1
  201. package/docs/types/plugMiniUSWebhookContext.html +1 -1
  202. package/docs/types/plugStatus.html +1 -1
  203. package/docs/types/plugWebhookContext.html +1 -1
  204. package/docs/types/relaySwitch1Context.html +1 -1
  205. package/docs/types/relaySwitch1PMContext.html +1 -1
  206. package/docs/types/relaySwitch1PMServiceData.html +1 -1
  207. package/docs/types/relaySwitch1PMStatus.html +1 -1
  208. package/docs/types/relaySwitch1ServiceData.html +1 -1
  209. package/docs/types/relaySwitch1Status.html +1 -1
  210. package/docs/types/remote.html +1 -1
  211. package/docs/types/remoteServiceData.html +1 -0
  212. package/docs/types/robotVacuumCleanerS1.html +1 -1
  213. package/docs/types/robotVacuumCleanerS1Plus.html +1 -1
  214. package/docs/types/robotVacuumCleanerS1PlusStatus.html +1 -1
  215. package/docs/types/robotVacuumCleanerS1PlusWebhookContext.html +1 -1
  216. package/docs/types/robotVacuumCleanerS1Status.html +1 -1
  217. package/docs/types/robotVacuumCleanerS1WebhookContext.html +1 -1
  218. package/docs/types/robotVacuumCleanerServiceData.html +1 -1
  219. package/docs/types/stripLight.html +1 -1
  220. package/docs/types/stripLightServiceData.html +1 -1
  221. package/docs/types/stripLightStatus.html +1 -1
  222. package/docs/types/stripLightWebhookContext.html +1 -1
  223. package/docs/types/waterLeakDetector.html +1 -1
  224. package/docs/types/waterLeakDetectorServiceData.html +1 -1
  225. package/docs/types/waterLeakDetectorStatus.html +1 -1
  226. package/docs/types/waterLeakDetectorWebhookContext.html +1 -1
  227. package/package.json +1 -1
  228. package/dist/advertising.d.ts +0 -44
  229. package/dist/advertising.d.ts.map +0 -1
  230. package/dist/advertising.js +0 -166
  231. package/dist/advertising.js.map +0 -1
  232. package/dist/device/woblindtilt.d.ts +0 -78
  233. package/dist/device/woblindtilt.d.ts.map +0 -1
  234. package/dist/device/woblindtilt.js +0 -181
  235. package/dist/device/woblindtilt.js.map +0 -1
  236. package/dist/device/wobulb.d.ts +0 -70
  237. package/dist/device/wobulb.d.ts.map +0 -1
  238. package/dist/device/wobulb.js +0 -136
  239. package/dist/device/wobulb.js.map +0 -1
  240. package/dist/device/woceilinglight.d.ts +0 -74
  241. package/dist/device/woceilinglight.d.ts.map +0 -1
  242. package/dist/device/woceilinglight.js +0 -161
  243. package/dist/device/woceilinglight.js.map +0 -1
  244. package/dist/device/wocontact.d.ts +0 -19
  245. package/dist/device/wocontact.d.ts.map +0 -1
  246. package/dist/device/wocontact.js +0 -48
  247. package/dist/device/wocontact.js.map +0 -1
  248. package/dist/device/wocurtain.d.ts +0 -52
  249. package/dist/device/wocurtain.d.ts.map +0 -1
  250. package/dist/device/wocurtain.js +0 -135
  251. package/dist/device/wocurtain.js.map +0 -1
  252. package/dist/device/wohand.d.ts +0 -50
  253. package/dist/device/wohand.d.ts.map +0 -1
  254. package/dist/device/wohand.js +0 -83
  255. package/dist/device/wohand.js.map +0 -1
  256. package/dist/device/wohub2.d.ts +0 -19
  257. package/dist/device/wohub2.d.ts.map +0 -1
  258. package/dist/device/wohub2.js +0 -40
  259. package/dist/device/wohub2.js.map +0 -1
  260. package/dist/device/wohumi.d.ts +0 -61
  261. package/dist/device/wohumi.d.ts.map +0 -1
  262. package/dist/device/wohumi.js +0 -114
  263. package/dist/device/wohumi.js.map +0 -1
  264. package/dist/device/wohumi2.d.ts +0 -61
  265. package/dist/device/wohumi2.d.ts.map +0 -1
  266. package/dist/device/wohumi2.js +0 -114
  267. package/dist/device/wohumi2.js.map +0 -1
  268. package/dist/device/woiosensorth.d.ts +0 -20
  269. package/dist/device/woiosensorth.d.ts.map +0 -1
  270. package/dist/device/woiosensorth.js +0 -49
  271. package/dist/device/woiosensorth.js.map +0 -1
  272. package/dist/device/wokeypad.d.ts +0 -19
  273. package/dist/device/wokeypad.d.ts.map +0 -1
  274. package/dist/device/wokeypad.js +0 -51
  275. package/dist/device/wokeypad.js.map +0 -1
  276. package/dist/device/woleak.d.ts +0 -20
  277. package/dist/device/woleak.d.ts.map +0 -1
  278. package/dist/device/woleak.js +0 -44
  279. package/dist/device/woleak.js.map +0 -1
  280. package/dist/device/woplugmini.d.ts +0 -52
  281. package/dist/device/woplugmini.d.ts.map +0 -1
  282. package/dist/device/woplugmini.js +0 -110
  283. package/dist/device/woplugmini.js.map +0 -1
  284. package/dist/device/woplugmini_jp.d.ts +0 -52
  285. package/dist/device/woplugmini_jp.d.ts.map +0 -1
  286. package/dist/device/woplugmini_jp.js +0 -110
  287. package/dist/device/woplugmini_jp.js.map +0 -1
  288. package/dist/device/wopresence.d.ts +0 -19
  289. package/dist/device/wopresence.d.ts.map +0 -1
  290. package/dist/device/wopresence.js +0 -39
  291. package/dist/device/wopresence.js.map +0 -1
  292. package/dist/device/worelayswitch1.d.ts +0 -36
  293. package/dist/device/worelayswitch1.d.ts.map +0 -1
  294. package/dist/device/worelayswitch1.js +0 -61
  295. package/dist/device/worelayswitch1.js.map +0 -1
  296. package/dist/device/worelayswitch1pm.d.ts +0 -36
  297. package/dist/device/worelayswitch1pm.d.ts.map +0 -1
  298. package/dist/device/worelayswitch1pm.js +0 -64
  299. package/dist/device/worelayswitch1pm.js.map +0 -1
  300. package/dist/device/wosensorth.d.ts +0 -13
  301. package/dist/device/wosensorth.d.ts.map +0 -1
  302. package/dist/device/wosensorth.js +0 -38
  303. package/dist/device/wosensorth.js.map +0 -1
  304. package/dist/device/wosensorthplus.d.ts +0 -13
  305. package/dist/device/wosensorthplus.d.ts.map +0 -1
  306. package/dist/device/wosensorthplus.js +0 -38
  307. package/dist/device/wosensorthplus.js.map +0 -1
  308. package/dist/device/wosensorthpro.d.ts +0 -13
  309. package/dist/device/wosensorthpro.d.ts.map +0 -1
  310. package/dist/device/wosensorthpro.js +0 -38
  311. package/dist/device/wosensorthpro.js.map +0 -1
  312. package/dist/device/wosensorthproco2.d.ts +0 -13
  313. package/dist/device/wosensorthproco2.d.ts.map +0 -1
  314. package/dist/device/wosensorthproco2.js +0 -40
  315. package/dist/device/wosensorthproco2.js.map +0 -1
  316. package/dist/device/wosmartlock.d.ts +0 -86
  317. package/dist/device/wosmartlock.d.ts.map +0 -1
  318. package/dist/device/wosmartlock.js +0 -198
  319. package/dist/device/wosmartlock.js.map +0 -1
  320. package/dist/device/wosmartlockpro.d.ts +0 -86
  321. package/dist/device/wosmartlockpro.d.ts.map +0 -1
  322. package/dist/device/wosmartlockpro.js +0 -200
  323. package/dist/device/wosmartlockpro.js.map +0 -1
  324. package/dist/device/wostrip.d.ts +0 -63
  325. package/dist/device/wostrip.d.ts.map +0 -1
  326. package/dist/device/wostrip.js +0 -131
  327. package/dist/device/wostrip.js.map +0 -1
  328. package/dist/test/advertising.test.d.ts +0 -2
  329. package/dist/test/advertising.test.d.ts.map +0 -1
  330. package/dist/test/advertising.test.js +0 -99
  331. package/dist/test/advertising.test.js.map +0 -1
  332. package/dist/test/device.test.d.ts +0 -2
  333. package/dist/test/device.test.d.ts.map +0 -1
  334. package/dist/test/device.test.js +0 -39
  335. package/dist/test/device.test.js.map +0 -1
  336. package/dist/test/index.test.js.map +0 -1
  337. package/dist/test/parameter-checker.test.d.ts +0 -2
  338. package/dist/test/parameter-checker.test.d.ts.map +0 -1
  339. package/dist/test/parameter-checker.test.js +0 -108
  340. package/dist/test/parameter-checker.test.js.map +0 -1
  341. package/dist/test/settings.test.js.map +0 -1
  342. package/dist/test/switchbot-ble.test.d.ts +0 -2
  343. package/dist/test/switchbot-ble.test.d.ts.map +0 -1
  344. package/dist/test/switchbot-ble.test.js +0 -45
  345. package/dist/test/switchbot-ble.test.js.map +0 -1
  346. package/dist/test/switchbot-openapi.test.d.ts +0 -2
  347. package/dist/test/switchbot-openapi.test.d.ts.map +0 -1
  348. package/dist/test/switchbot-openapi.test.js +0 -96
  349. package/dist/test/switchbot-openapi.test.js.map +0 -1
  350. package/dist/test/woblindtilt.test.d.ts +0 -2
  351. package/dist/test/woblindtilt.test.d.ts.map +0 -1
  352. package/dist/test/woblindtilt.test.js +0 -76
  353. package/dist/test/woblindtilt.test.js.map +0 -1
  354. package/dist/test/wobulb.test.d.ts +0 -2
  355. package/dist/test/wobulb.test.d.ts.map +0 -1
  356. package/dist/test/wobulb.test.js +0 -95
  357. package/dist/test/wobulb.test.js.map +0 -1
  358. package/dist/test/woceilinglight.test.d.ts +0 -2
  359. package/dist/test/woceilinglight.test.d.ts.map +0 -1
  360. package/dist/test/woceilinglight.test.js +0 -81
  361. package/dist/test/woceilinglight.test.js.map +0 -1
  362. package/dist/test/wocontact.test.d.ts +0 -2
  363. package/dist/test/wocontact.test.d.ts.map +0 -1
  364. package/dist/test/wocontact.test.js +0 -65
  365. package/dist/test/wocontact.test.js.map +0 -1
  366. package/dist/test/wocurtain.test.d.ts +0 -2
  367. package/dist/test/wocurtain.test.d.ts.map +0 -1
  368. package/dist/test/wocurtain.test.js +0 -75
  369. package/dist/test/wocurtain.test.js.map +0 -1
  370. package/dist/test/wohand.test.d.ts +0 -2
  371. package/dist/test/wohand.test.d.ts.map +0 -1
  372. package/dist/test/wohand.test.js +0 -56
  373. package/dist/test/wohand.test.js.map +0 -1
  374. package/dist/test/wohub2.test.d.ts +0 -2
  375. package/dist/test/wohub2.test.d.ts.map +0 -1
  376. package/dist/test/wohub2.test.js +0 -80
  377. package/dist/test/wohub2.test.js.map +0 -1
  378. package/dist/test/wohumi.test.d.ts +0 -2
  379. package/dist/test/wohumi.test.d.ts.map +0 -1
  380. package/dist/test/wohumi.test.js +0 -34
  381. package/dist/test/wohumi.test.js.map +0 -1
  382. package/dist/test/wohumi2.test.d.ts +0 -2
  383. package/dist/test/wohumi2.test.d.ts.map +0 -1
  384. package/dist/test/wohumi2.test.js +0 -34
  385. package/dist/test/wohumi2.test.js.map +0 -1
  386. package/dist/test/woiosensorth.test.d.ts +0 -2
  387. package/dist/test/woiosensorth.test.d.ts.map +0 -1
  388. package/dist/test/woiosensorth.test.js +0 -40
  389. package/dist/test/woiosensorth.test.js.map +0 -1
  390. package/dist/test/wokeypad.test.d.ts +0 -2
  391. package/dist/test/wokeypad.test.d.ts.map +0 -1
  392. package/dist/test/wokeypad.test.js +0 -46
  393. package/dist/test/wokeypad.test.js.map +0 -1
  394. package/dist/test/woleak.test.d.ts +0 -2
  395. package/dist/test/woleak.test.d.ts.map +0 -1
  396. package/dist/test/woleak.test.js +0 -52
  397. package/dist/test/woleak.test.js.map +0 -1
  398. package/dist/test/woplugmini.test.d.ts +0 -2
  399. package/dist/test/woplugmini.test.d.ts.map +0 -1
  400. package/dist/test/woplugmini.test.js +0 -91
  401. package/dist/test/woplugmini.test.js.map +0 -1
  402. package/dist/test/woplugmini_jp.test.d.ts +0 -2
  403. package/dist/test/woplugmini_jp.test.d.ts.map +0 -1
  404. package/dist/test/woplugmini_jp.test.js +0 -91
  405. package/dist/test/woplugmini_jp.test.js.map +0 -1
  406. package/dist/test/wopresence.test.d.ts +0 -2
  407. package/dist/test/wopresence.test.d.ts.map +0 -1
  408. package/dist/test/wopresence.test.js +0 -68
  409. package/dist/test/wopresence.test.js.map +0 -1
  410. package/dist/test/wosensorth.test.d.ts +0 -2
  411. package/dist/test/wosensorth.test.d.ts.map +0 -1
  412. package/dist/test/wosensorth.test.js +0 -30
  413. package/dist/test/wosensorth.test.js.map +0 -1
  414. package/dist/test/wosensorthplus.test.d.ts +0 -2
  415. package/dist/test/wosensorthplus.test.d.ts.map +0 -1
  416. package/dist/test/wosensorthplus.test.js +0 -30
  417. package/dist/test/wosensorthplus.test.js.map +0 -1
  418. package/dist/test/wosensorthpro.test.d.ts +0 -2
  419. package/dist/test/wosensorthpro.test.d.ts.map +0 -1
  420. package/dist/test/wosensorthpro.test.js +0 -30
  421. package/dist/test/wosensorthpro.test.js.map +0 -1
  422. package/dist/test/wosensorthproco2.test.d.ts +0 -2
  423. package/dist/test/wosensorthproco2.test.d.ts.map +0 -1
  424. package/dist/test/wosensorthproco2.test.js +0 -33
  425. package/dist/test/wosensorthproco2.test.js.map +0 -1
  426. package/dist/test/wosmartlock.test.d.ts +0 -2
  427. package/dist/test/wosmartlock.test.d.ts.map +0 -1
  428. package/dist/test/wosmartlock.test.js +0 -151
  429. package/dist/test/wosmartlock.test.js.map +0 -1
  430. package/dist/test/wosmartlockpro.test.d.ts +0 -2
  431. package/dist/test/wosmartlockpro.test.d.ts.map +0 -1
  432. package/dist/test/wosmartlockpro.test.js +0 -150
  433. package/dist/test/wosmartlockpro.test.js.map +0 -1
  434. package/dist/test/wostrip.test.d.ts +0 -2
  435. package/dist/test/wostrip.test.d.ts.map +0 -1
  436. package/dist/test/wostrip.test.js +0 -102
  437. package/dist/test/wostrip.test.js.map +0 -1
  438. /package/dist/{test/index.test.d.ts → index.test.d.ts} +0 -0
  439. /package/dist/{test/settings.test.d.ts → settings.test.d.ts} +0 -0
package/dist/device.d.ts CHANGED
@@ -1,7 +1,237 @@
1
1
  import type * as Noble from '@stoprocent/noble';
2
- import type { Chars, NobleTypes, SwitchBotBLEModel, SwitchBotBLEModelFriendlyName, SwitchBotBLEModelName } from './types/types.js';
2
+ import type { batteryCirculatorFanServiceData, blindTiltServiceData, botServiceData, ceilingLightProServiceData, ceilingLightServiceData, colorBulbServiceData, contactSensorServiceData, curtain3ServiceData, curtainServiceData, hub2ServiceData, humidifier2ServiceData, humidifierServiceData, keypadDetectorServiceData, lockProServiceData, lockServiceData, meterPlusServiceData, meterProCO2ServiceData, meterProServiceData, meterServiceData, motionSensorServiceData, outdoorMeterServiceData, plugMiniJPServiceData, plugMiniUSServiceData, relaySwitch1PMServiceData, relaySwitch1ServiceData, remoteServiceData, robotVacuumCleanerServiceData, stripLightServiceData, waterLeakDetectorServiceData } from './types/bledevicestatus.js';
3
3
  import { Buffer } from 'node:buffer';
4
4
  import { EventEmitter } from 'node:events';
5
+ export type MacAddress = string;
6
+ export interface ad {
7
+ id: string;
8
+ address: string;
9
+ rssi: number;
10
+ serviceData: botServiceData | colorBulbServiceData | contactSensorServiceData | curtainServiceData | curtain3ServiceData | stripLightServiceData | lockServiceData | lockProServiceData | meterServiceData | meterPlusServiceData | meterProServiceData | meterProCO2ServiceData | motionSensorServiceData | outdoorMeterServiceData | plugMiniUSServiceData | plugMiniJPServiceData | blindTiltServiceData | ceilingLightServiceData | ceilingLightProServiceData | hub2ServiceData | batteryCirculatorFanServiceData | waterLeakDetectorServiceData | humidifierServiceData | humidifier2ServiceData | robotVacuumCleanerServiceData | keypadDetectorServiceData | relaySwitch1PMServiceData | relaySwitch1ServiceData | remoteServiceData;
11
+ [key: string]: unknown;
12
+ }
13
+ export type ondiscover = (device: SwitchbotDevice) => Promise<void> | void;
14
+ export type onadvertisement = (ad: ad) => Promise<void> | void;
15
+ interface DeviceInfo {
16
+ Model: SwitchBotModel;
17
+ BLEModel: SwitchBotBLEModel;
18
+ BLEModelName: SwitchBotBLEModelName;
19
+ ModelFriendlyName: SwitchBotBLEModelFriendlyName;
20
+ }
21
+ export declare interface SwitchBotBLEDevice {
22
+ Bot: DeviceInfo;
23
+ Curtain: DeviceInfo;
24
+ Curtain3: DeviceInfo;
25
+ Humidifier: DeviceInfo;
26
+ Meter: DeviceInfo;
27
+ MeterPlus: DeviceInfo;
28
+ MeterPro: DeviceInfo;
29
+ MeterProCO2: DeviceInfo;
30
+ Hub2: DeviceInfo;
31
+ OutdoorMeter: DeviceInfo;
32
+ MotionSensor: DeviceInfo;
33
+ ContactSensor: DeviceInfo;
34
+ ColorBulb: DeviceInfo;
35
+ StripLight: DeviceInfo;
36
+ PlugMiniUS: DeviceInfo;
37
+ PlugMiniJP: DeviceInfo;
38
+ Lock: DeviceInfo;
39
+ LockPro: DeviceInfo;
40
+ CeilingLight: DeviceInfo;
41
+ CeilingLightPro: DeviceInfo;
42
+ BlindTilt: DeviceInfo;
43
+ Unknown: DeviceInfo;
44
+ }
45
+ export declare enum SwitchBotModel {
46
+ HubMini = "W0202200",
47
+ HubPlus = "SwitchBot Hub S1",
48
+ Hub2 = "W3202100",
49
+ Bot = "SwitchBot S1",
50
+ Curtain = "W0701600",
51
+ Curtain3 = "W2400000",
52
+ Humidifier = "W0801800",
53
+ Humidifier2 = "WXXXXXXX",
54
+ Plug = "SP11",// Currently only available in Japan
55
+ Meter = "SwitchBot MeterTH S1",
56
+ MeterPlusJP = "W2201500",
57
+ MeterPlusUS = "W2301500",
58
+ MeterPro = "W4900000",
59
+ MeterProCO2 = "W4900010",
60
+ OutdoorMeter = "W3400010",
61
+ MotionSensor = "W1101500",
62
+ ContactSensor = "W1201500",
63
+ ColorBulb = "W1401400",
64
+ StripLight = "W1701100",
65
+ PlugMiniUS = "W1901400/W1901401",
66
+ PlugMiniJP = "W2001400/W2001401",
67
+ Lock = "W1601700",
68
+ LockPro = "W3500000",
69
+ Keypad = "W2500010",
70
+ KeypadTouch = "W2500020",
71
+ K10 = "K10+",
72
+ K10Pro = "K10+ Pro",
73
+ WoSweeper = "WoSweeper",
74
+ WoSweeperMini = "WoSweeperMini",
75
+ RobotVacuumCleanerS1 = "W3011000",// Currently only available in Japan.
76
+ RobotVacuumCleanerS1Plus = "W3011010",// Currently only available in Japan.
77
+ RobotVacuumCleanerS10 = "W3211800",
78
+ Remote = "Remote",
79
+ UniversalRemote = "UniversalRemote",
80
+ CeilingLight = "W2612230/W2612240",// Currently only available in Japan.
81
+ CeilingLightPro = "W2612210/W2612220",// Currently only available in Japan.
82
+ IndoorCam = "W1301200",
83
+ PanTiltCam = "W1801200",
84
+ PanTiltCam2K = "W3101100",
85
+ BlindTilt = "W2701600",
86
+ BatteryCirculatorFan = "W3800510",
87
+ CirculatorFan = "W3800511",
88
+ WaterDetector = "W4402000",
89
+ RelaySwitch1 = "W5502300",
90
+ RelaySwitch1PM = "W5502310",
91
+ Unknown = "Unknown"
92
+ }
93
+ export declare enum SwitchBotBLEModel {
94
+ Bot = "H",
95
+ Curtain = "c",
96
+ Curtain3 = "{",
97
+ Humidifier = "e",
98
+ Humidifier2 = "#",
99
+ Meter = "T",
100
+ MeterPlus = "i",
101
+ MeterPro = "4",
102
+ MeterProCO2 = "5",
103
+ Hub2 = "v",
104
+ OutdoorMeter = "w",
105
+ MotionSensor = "s",
106
+ ContactSensor = "d",
107
+ ColorBulb = "u",
108
+ StripLight = "r",
109
+ PlugMiniUS = "g",
110
+ PlugMiniJP = "j",// Only available in Japan.
111
+ Lock = "o",
112
+ LockPro = "$",
113
+ CeilingLight = "q",// Currently only available in Japan.
114
+ CeilingLightPro = "n",// Currently only available in Japan.
115
+ BlindTilt = "x",
116
+ Leak = "&",
117
+ Keypad = "y",
118
+ RelaySwitch1 = ";",
119
+ RelaySwitch1PM = "<",
120
+ Remote = "b",
121
+ Unknown = "Unknown"
122
+ }
123
+ export declare enum SwitchBotBLEModelName {
124
+ Bot = "WoHand",
125
+ Hub2 = "WoHub2",
126
+ ColorBulb = "WoBulb",
127
+ Curtain = "WoCurtain",
128
+ Curtain3 = "WoCurtain3",
129
+ Humidifier = "WoHumi",
130
+ Humidifier2 = "WoHumi2",
131
+ Meter = "WoSensorTH",
132
+ MeterPlus = "WoSensorTHPlus",
133
+ MeterPro = "WoSensorTHP",
134
+ MeterProCO2 = "WoSensorTHPc",
135
+ Lock = "WoSmartLock",
136
+ LockPro = "WoSmartLockPro",
137
+ PlugMini = "WoPlugMini",
138
+ StripLight = "WoStrip",
139
+ OutdoorMeter = "WoIOSensorTH",
140
+ ContactSensor = "WoContact",
141
+ MotionSensor = "WoMotion",
142
+ BlindTilt = "WoBlindTilt",
143
+ CeilingLight = "WoCeilingLight",
144
+ CeilingLightPro = "WoCeilingLightPro",
145
+ Leak = "WoLeakDetector",
146
+ Keypad = "WoKeypad",
147
+ RelaySwitch1 = "WoRelaySwitch1Plus",
148
+ RelaySwitch1PM = "WoRelaySwitch1PM",
149
+ Remote = "WoRemote",
150
+ Unknown = "Unknown"
151
+ }
152
+ export declare enum SwitchBotBLEModelFriendlyName {
153
+ Bot = "Bot",
154
+ Hub2 = "Hub 2",
155
+ ColorBulb = "Color Bulb",
156
+ Curtain = "Curtain",
157
+ Curtain3 = "Curtain 3",
158
+ Humidifier = "Humidifier",
159
+ Humidifier2 = "Humidifier2",
160
+ Meter = "Meter",
161
+ Lock = "Lock",
162
+ LockPro = "Lock Pro",
163
+ PlugMini = "Plug Mini",
164
+ StripLight = "Strip Light",
165
+ MeterPlus = "Meter Plus",
166
+ MeterPro = "Meter Pro",
167
+ MeterProCO2 = "Meter Pro CO2",
168
+ BatteryCirculatorFan = "Battery Circulator Fan",
169
+ CirculatorFan = "Circulator Fan",
170
+ OutdoorMeter = "Outdoor Meter",
171
+ ContactSensor = "Contact Sensor",
172
+ MotionSensor = "Motion Sensor",
173
+ BlindTilt = "Blind Tilt",
174
+ CeilingLight = "Ceiling Light",
175
+ CeilingLightPro = "Ceiling Light Pro",
176
+ Leak = "Water Detector",
177
+ Keypad = "Keypad",
178
+ RelaySwitch1 = "Relay Switch 1",
179
+ RelaySwitch1PM = "Relay Switch 1PM",
180
+ Remote = "Remote",
181
+ Unknown = "Unknown"
182
+ }
183
+ export interface Params {
184
+ duration?: number;
185
+ model?: string;
186
+ id?: string;
187
+ quick?: boolean;
188
+ noble?: typeof Noble;
189
+ }
190
+ export interface ErrorObject {
191
+ code: string;
192
+ message: string;
193
+ }
194
+ export interface Chars {
195
+ write: Noble.Characteristic | null;
196
+ notify: Noble.Characteristic | null;
197
+ device: Noble.Characteristic | null;
198
+ }
199
+ export interface NobleTypes {
200
+ noble: typeof Noble;
201
+ state: 'unknown' | 'resetting' | 'unsupported' | 'unauthorized' | 'poweredOff' | 'poweredOn';
202
+ peripheral: Noble.Peripheral;
203
+ }
204
+ export interface ServiceData {
205
+ model: string;
206
+ [key: string]: unknown;
207
+ }
208
+ export interface AdvertisementData {
209
+ serviceData: Buffer | null;
210
+ manufacturerData: Buffer | null;
211
+ }
212
+ export interface Rule {
213
+ required?: boolean;
214
+ min?: number;
215
+ max?: number;
216
+ minBytes?: number;
217
+ maxBytes?: number;
218
+ pattern?: RegExp;
219
+ enum?: unknown[];
220
+ type?: 'float' | 'integer' | 'boolean' | 'array' | 'object' | 'string';
221
+ }
222
+ /**
223
+ * Enum for log levels.
224
+ */
225
+ export declare enum LogLevel {
226
+ SUCCESS = "success",
227
+ DEBUGSUCCESS = "debugsuccess",
228
+ WARN = "warn",
229
+ DEBUGWARN = "debugwarn",
230
+ ERROR = "error",
231
+ DEBUGERROR = "debugerror",
232
+ DEBUG = "debug",
233
+ INFO = "info"
234
+ }
5
235
  /**
6
236
  * Represents a Switchbot Device.
7
237
  */
@@ -50,7 +280,7 @@ export declare class SwitchbotDevice extends EventEmitter {
50
280
  * Internal method to handle the connection process.
51
281
  * @returns A Promise that resolves when the connection is complete.
52
282
  */
53
- private internalConnect;
283
+ internalConnect(): Promise<void>;
54
284
  /**
55
285
  * Retrieves the device characteristics.
56
286
  * @returns A Promise that resolves with the device characteristics.
@@ -123,4 +353,965 @@ export declare class SwitchbotDevice extends EventEmitter {
123
353
  */
124
354
  private writeCharacteristic;
125
355
  }
356
+ /**
357
+ * Represents the advertising data parser for SwitchBot devices.
358
+ */
359
+ export declare class Advertising {
360
+ constructor();
361
+ /**
362
+ * Parses the advertisement data coming from SwitchBot device.
363
+ *
364
+ * This function processes advertising packets received from SwitchBot devices
365
+ * and extracts relevant information based on the device type.
366
+ *
367
+ * @param {NobleTypes['peripheral']} peripheral - The peripheral device object from noble.
368
+ * @param {Function} emitLog - The function to emit log messages.
369
+ * @returns {Promise<Ad | null>} - An object containing parsed data specific to the SwitchBot device type, or `null` if the device is not recognized.
370
+ */
371
+ static parse(peripheral: NobleTypes['peripheral'], emitLog: (level: string, message: string) => void): Promise<ad | null>;
372
+ /**
373
+ * Validates if the buffer is a valid Buffer object with a minimum length.
374
+ *
375
+ * @param {any} buffer - The buffer to validate.
376
+ * @returns {boolean} - True if the buffer is valid, false otherwise.
377
+ */
378
+ private static validateBuffer;
379
+ /**
380
+ * Parses the service data based on the device model.
381
+ *
382
+ * @param {string} model - The device model.
383
+ * @param {Buffer} serviceData - The service data buffer.
384
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
385
+ * @param {Function} emitLog - The function to emit log messages.
386
+ * @returns {Promise<any>} - The parsed service data.
387
+ */
388
+ static parseServiceData(model: string, serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<any>;
389
+ /**
390
+ * Formats the address of the peripheral.
391
+ *
392
+ * @param {NobleTypes['peripheral']} peripheral - The peripheral device object from noble.
393
+ * @returns {string} - The formatted address.
394
+ */
395
+ private static formatAddress;
396
+ }
397
+ /**
398
+ * Class representing a WoBlindTilt device.
399
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/curtain.md
400
+ */
401
+ export declare class WoBlindTilt extends SwitchbotDevice {
402
+ private reverse;
403
+ /**
404
+ * Parses the service data and manufacturer data for the WoBlindTilt device.
405
+ * @param {Buffer} serviceData - The service data buffer.
406
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
407
+ * @param {Function} emitLog - The function to emit log messages.
408
+ * @param {boolean} [reverse] - Whether to reverse the tilt percentage.
409
+ * @returns {Promise<blindTiltServiceData | null>} - The parsed data object or null if the data is invalid.
410
+ */
411
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void, reverse?: boolean): Promise<blindTiltServiceData | null>;
412
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
413
+ /**
414
+ * Opens the blind tilt to the fully open position.
415
+ * @returns {Promise<void>}
416
+ */
417
+ open(): Promise<void>;
418
+ /**
419
+ * Closes the blind tilt up to the nearest endpoint.
420
+ * @returns {Promise<void>}
421
+ */
422
+ closeUp(): Promise<void>;
423
+ /**
424
+ * Closes the blind tilt down to the nearest endpoint.
425
+ * @returns {Promise<void>}
426
+ */
427
+ closeDown(): Promise<void>;
428
+ /**
429
+ * Closes the blind tilt to the nearest endpoint.
430
+ * @returns {Promise<void>}
431
+ */
432
+ close(): Promise<void>;
433
+ /**
434
+ * Retrieves the current position of the blind tilt.
435
+ * @returns {Promise<number>} - The current position of the blind tilt (0-100).
436
+ */
437
+ getPosition(): Promise<number>;
438
+ /**
439
+ * Retrieves the advertised value for a given key.
440
+ * @param {string} key - The key for the advertised value.
441
+ * @returns {Promise<number>} - The advertised value.
442
+ * @private
443
+ */
444
+ private _getAdvValue;
445
+ /**
446
+ * Retrieves the basic information of the blind tilt.
447
+ * @returns {Promise<object | null>} - A promise that resolves to an object containing the basic information of the blind tilt.
448
+ */
449
+ getBasicInfo(): Promise<object | null>;
450
+ /**
451
+ * Pauses the blind tilt operation.
452
+ * @returns {Promise<void>}
453
+ */
454
+ pause(): Promise<void>;
455
+ /**
456
+ * Runs the blind tilt to the specified position.
457
+ * @param {number} percent - The target position percentage (0-100).
458
+ * @param {number} mode - The running mode (0 or 1).
459
+ * @returns {Promise<void>}
460
+ */
461
+ runToPos(percent: number, mode: number): Promise<void>;
462
+ /**
463
+ * Sends a command to operate the blind tilt and handles the response.
464
+ * @param {number[]} bytes - The byte array representing the command to be sent to the device.
465
+ * @returns {Promise<void>}
466
+ * @private
467
+ */
468
+ operateBlindTilt(bytes: number[]): Promise<void>;
469
+ }
470
+ /**
471
+ * Class representing a WoBulb device.
472
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/colorbulb.md
473
+ */
474
+ export declare class WoBulb extends SwitchbotDevice {
475
+ /**
476
+ * Parses the service data for WoBulb.
477
+ * @param {Buffer} serviceData - The service data buffer.
478
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
479
+ * @param {Function} emitLog - The function to emit log messages.
480
+ * @returns {Promise<colorBulbServiceData | null>} - Parsed service data or null if invalid.
481
+ */
482
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<colorBulbServiceData | null>;
483
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
484
+ /**
485
+ * Reads the state of the bulb.
486
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the bulb is ON (true) or OFF (false).
487
+ */
488
+ readState(): Promise<boolean>;
489
+ /**
490
+ * Sets the state of the bulb.
491
+ * @param {number[]} reqByteArray - The request byte array.
492
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the operation was successful.
493
+ * @private
494
+ */
495
+ setState(reqByteArray: number[]): Promise<boolean>;
496
+ /**
497
+ * Turns on the bulb.
498
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the bulb is ON (true).
499
+ */
500
+ turnOn(): Promise<boolean>;
501
+ /**
502
+ * Turns off the bulb.
503
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the bulb is OFF (false).
504
+ */
505
+ turnOff(): Promise<boolean>;
506
+ /**
507
+ * Sets the brightness of the bulb.
508
+ * @param {number} brightness - The brightness percentage (0-100).
509
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the operation was successful.
510
+ */
511
+ setBrightness(brightness: number): Promise<boolean>;
512
+ /**
513
+ * Sets the color temperature of the bulb.
514
+ * @param {number} color_temperature - The color temperature percentage (0-100).
515
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the operation was successful.
516
+ */
517
+ setColorTemperature(color_temperature: number): Promise<boolean>;
518
+ /**
519
+ * Sets the RGB color of the bulb.
520
+ * @param {number} brightness - The brightness percentage (0-100).
521
+ * @param {number} red - The red color value (0-255).
522
+ * @param {number} green - The green color value (0-255).
523
+ * @param {number} blue - The blue color value (0-255).
524
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the operation was successful.
525
+ */
526
+ setRGB(brightness: number, red: number, green: number, blue: number): Promise<boolean>;
527
+ /**
528
+ * Sends a command to the bulb.
529
+ * @param {number[]} bytes - The command bytes.
530
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the operation was successful.
531
+ * @private
532
+ */
533
+ private operateBulb;
534
+ }
535
+ /**
536
+ * Class representing a WoCeilingLight device.
537
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/colorbulb.md
538
+ */
539
+ export declare class WoCeilingLight extends SwitchbotDevice {
540
+ /**
541
+ * Parses the service data for WoCeilingLight.
542
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
543
+ * @param {Function} emitLog - The function to emit log messages.
544
+ * @returns {Promise<ceilingLightServiceData | null>} - Parsed service data or null if invalid.
545
+ */
546
+ static parseServiceData(manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<ceilingLightServiceData | null>;
547
+ /**
548
+ * Parses the service data for WoCeilingLight Pro.
549
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
550
+ * @param {Function} emitLog - The function to emit log messages.
551
+ * @returns {Promise<ceilingLightProServiceData | null>} - Parsed service data or null if invalid.
552
+ */
553
+ static parseServiceData_Pro(manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<ceilingLightProServiceData | null>;
554
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
555
+ /**
556
+ * Reads the state of the ceiling light.
557
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the light is ON (true) or OFF (false).
558
+ */
559
+ readState(): Promise<boolean>;
560
+ /**
561
+ * Sets the state of the ceiling light.
562
+ * @param {number[]} reqByteArray - The request byte array.
563
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the operation was successful.
564
+ */
565
+ setState(reqByteArray: number[]): Promise<boolean>;
566
+ /**
567
+ * Turns on the ceiling light.
568
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the light is ON (true).
569
+ */
570
+ turnOn(): Promise<boolean>;
571
+ /**
572
+ * Turns off the ceiling light.
573
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the light is OFF (false).
574
+ */
575
+ turnOff(): Promise<boolean>;
576
+ /**
577
+ * Sets the brightness of the ceiling light.
578
+ * @param {number} brightness - The brightness percentage (0-100).
579
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the operation was successful.
580
+ */
581
+ setBrightness(brightness: number): Promise<boolean>;
582
+ /**
583
+ * Sets the color temperature of the ceiling light.
584
+ * @param {number} color_temperature - The color temperature percentage (0-100).
585
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the operation was successful.
586
+ */
587
+ setColorTemperature(color_temperature: number): Promise<boolean>;
588
+ /**
589
+ * Sets the RGB color of the ceiling light.
590
+ * @param {number} brightness - The brightness percentage (0-100).
591
+ * @param {number} red - The red color value (0-255).
592
+ * @param {number} green - The green color value (0-255).
593
+ * @param {number} blue - The blue color value (0-255).
594
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the operation was successful.
595
+ */
596
+ setRGB(brightness: number, red: number, green: number, blue: number): Promise<boolean>;
597
+ /**
598
+ * Sends a command to the ceiling light.
599
+ * @param {number[]} bytes - The command bytes.
600
+ * @returns {Promise<boolean>} - Resolves with a boolean indicating whether the operation was successful.
601
+ */
602
+ operateCeilingLight(bytes: number[]): Promise<boolean>;
603
+ }
604
+ /**
605
+ * Class representing a WoContact device.
606
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/contactsensor.md
607
+ */
608
+ export declare class WoContact extends SwitchbotDevice {
609
+ /**
610
+ * Parses the service data for WoContact.
611
+ * @param {Buffer} serviceData - The service data buffer.
612
+ * @param {Function} emitLog - The function to emit log messages.
613
+ * @returns {Promise<contactSensorServiceData | null>} - Parsed service data or null if invalid.
614
+ */
615
+ static parseServiceData(serviceData: Buffer, emitLog: (level: string, message: string) => void): Promise<contactSensorServiceData | null>;
616
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
617
+ }
618
+ /**
619
+ * Class representing a WoCurtain device.
620
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/curtain.md
621
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/curtain3.md
622
+ */
623
+ export declare class WoCurtain extends SwitchbotDevice {
624
+ /**
625
+ * Parses the service data for WoCurtain.
626
+ * @param {Buffer} serviceData - The service data buffer.
627
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
628
+ * @param {Function} emitLog - The function to emit log messages.
629
+ * @param {boolean} [reverse] - Whether to reverse the position.
630
+ * @returns {Promise<curtainServiceData | curtain3ServiceData | null>} - Parsed service data or null if invalid.
631
+ */
632
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void, reverse?: boolean): Promise<curtainServiceData | curtain3ServiceData | null>;
633
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
634
+ /**
635
+ * Opens the curtain.
636
+ * @param {number} [mode] - Running mode (0x01 = QuietDrift, 0xFF = Default).
637
+ * @returns {Promise<void>}
638
+ */
639
+ open(mode?: number): Promise<void>;
640
+ /**
641
+ * Closes the curtain.
642
+ * @param {number} [mode] - Running mode (0x01 = QuietDrift, 0xFF = Default).
643
+ * @returns {Promise<void>}
644
+ */
645
+ close(mode?: number): Promise<void>;
646
+ /**
647
+ * Pauses the curtain.
648
+ * @returns {Promise<void>}
649
+ */
650
+ pause(): Promise<void>;
651
+ /**
652
+ * Runs the curtain to the target position.
653
+ * @param {number} percent - The percentage of the target position.
654
+ * @param {number} [mode] - Running mode (0x01 = QuietDrift, 0xFF = Default).
655
+ * @returns {Promise<void>}
656
+ */
657
+ runToPos(percent: number, mode?: number): Promise<void>;
658
+ /**
659
+ * Sends a command to the curtain.
660
+ * @param {number[]} bytes - The command bytes.
661
+ * @returns {Promise<void>}
662
+ */
663
+ operateCurtain(bytes: number[]): Promise<void>;
664
+ }
665
+ /**
666
+ * Class representing a WoHand device.
667
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/bot.md
668
+ */
669
+ export declare class WoHand extends SwitchbotDevice {
670
+ /**
671
+ * Parses the service data for WoHand.
672
+ * @param {Buffer} serviceData - The service data buffer.
673
+ * @param {Function} emitLog - The function to emit log messages.
674
+ * @returns {Promise<botServiceData | null>} - Parsed service data or null if invalid.
675
+ */
676
+ static parseServiceData(serviceData: Buffer, emitLog: (level: string, message: string) => void): Promise<botServiceData | null>;
677
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
678
+ /**
679
+ * Sends a command to the bot.
680
+ * @param {Buffer} reqBuf - The command buffer.
681
+ * @returns {Promise<void>}
682
+ */
683
+ protected sendCommand(reqBuf: Buffer): Promise<void>;
684
+ /**
685
+ * Presses the bot.
686
+ * @returns {Promise<void>}
687
+ */
688
+ press(): Promise<void>;
689
+ /**
690
+ * Turns on the bot.
691
+ * @returns {Promise<void>}
692
+ */
693
+ turnOn(): Promise<void>;
694
+ /**
695
+ * Turns off the bot.
696
+ * @returns {Promise<void>}
697
+ */
698
+ turnOff(): Promise<void>;
699
+ /**
700
+ * Moves the bot down.
701
+ * @returns {Promise<void>}
702
+ */
703
+ down(): Promise<void>;
704
+ /**
705
+ * Moves the bot up.
706
+ * @returns {Promise<void>}
707
+ */
708
+ up(): Promise<void>;
709
+ }
710
+ /**
711
+ * Class representing a WoHub2 device.
712
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md
713
+ */
714
+ export declare class WoHub2 extends SwitchbotDevice {
715
+ /**
716
+ * Parses the service data for WoHub2.
717
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
718
+ * @param {Function} emitLog - The function to emit log messages.
719
+ * @returns {Promise<hub2ServiceData | null>} - Parsed service data or null if invalid.
720
+ */
721
+ static parseServiceData(manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<hub2ServiceData | null>;
722
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
723
+ }
724
+ /**
725
+ * Class representing a WoHumi device.
726
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/tree/latest/devicetypes
727
+ */
728
+ export declare class WoHumi extends SwitchbotDevice {
729
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
730
+ /**
731
+ * Parses the service data for WoHumi.
732
+ * @param {Buffer} serviceData - The service data buffer.
733
+ * @param {Function} emitLog - The function to emit log messages.
734
+ * @returns {Promise<humidifierServiceData | null>} - Parsed service data or null if invalid.
735
+ */
736
+ static parseServiceData(serviceData: Buffer, emitLog: (level: string, message: string) => void): Promise<humidifierServiceData | null>;
737
+ /**
738
+ * Sends a command to the humidifier.
739
+ * @param {Buffer} reqBuf - The command buffer.
740
+ * @returns {Promise<void>}
741
+ */
742
+ protected operateHumi(reqBuf: Buffer): Promise<void>;
743
+ /**
744
+ * Turns on the humidifier.
745
+ * @returns {Promise<void>}
746
+ */
747
+ turnOn(): Promise<void>;
748
+ /**
749
+ * Turns off the humidifier.
750
+ * @returns {Promise<void>}
751
+ */
752
+ turnOff(): Promise<void>;
753
+ /**
754
+ * Increases the humidifier setting.
755
+ * @returns {Promise<void>}
756
+ */
757
+ increase(): Promise<void>;
758
+ /**
759
+ * Decreases the humidifier setting.
760
+ * @returns {Promise<void>}
761
+ */
762
+ decrease(): Promise<void>;
763
+ /**
764
+ * Sets the humidifier to auto mode.
765
+ * @returns {Promise<void>}
766
+ */
767
+ setAutoMode(): Promise<void>;
768
+ /**
769
+ * Sets the humidifier to manual mode.
770
+ * @returns {Promise<void>}
771
+ */
772
+ setManualMode(): Promise<void>;
773
+ /**
774
+ * Sets the humidifier level.
775
+ * @param {number} level - The level to set (0-100).
776
+ * @returns {Promise<void>}
777
+ */
778
+ percentage(level: number): Promise<void>;
779
+ }
780
+ /**
781
+ * Class representing a WoHumi device.
782
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/tree/latest/devicetypes
783
+ */
784
+ export declare class WoHumi2 extends SwitchbotDevice {
785
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
786
+ /**
787
+ * Parses the service data for WoHumi.
788
+ * @param {Buffer} serviceData - The service data buffer.
789
+ * @param {Function} emitLog - The function to emit log messages.
790
+ * @returns {Promise<humidifier2ServiceData | null>} - Parsed service data or null if invalid.
791
+ */
792
+ static parseServiceData(serviceData: Buffer, emitLog: (level: string, message: string) => void): Promise<humidifier2ServiceData | null>;
793
+ /**
794
+ * Sends a command to the humidifier.
795
+ * @param {Buffer} reqBuf - The command buffer.
796
+ * @returns {Promise<void>}
797
+ */
798
+ protected operateHumi(reqBuf: Buffer): Promise<void>;
799
+ /**
800
+ * Turns on the humidifier.
801
+ * @returns {Promise<void>}
802
+ */
803
+ turnOn(): Promise<void>;
804
+ /**
805
+ * Turns off the humidifier.
806
+ * @returns {Promise<void>}
807
+ */
808
+ turnOff(): Promise<void>;
809
+ /**
810
+ * Increases the humidifier setting.
811
+ * @returns {Promise<void>}
812
+ */
813
+ increase(): Promise<void>;
814
+ /**
815
+ * Decreases the humidifier setting.
816
+ * @returns {Promise<void>}
817
+ */
818
+ decrease(): Promise<void>;
819
+ /**
820
+ * Sets the humidifier to auto mode.
821
+ * @returns {Promise<void>}
822
+ */
823
+ setAutoMode(): Promise<void>;
824
+ /**
825
+ * Sets the humidifier to manual mode.
826
+ * @returns {Promise<void>}
827
+ */
828
+ setManualMode(): Promise<void>;
829
+ /**
830
+ * Sets the humidifier level.
831
+ * @param {number} level - The level to set (0-100).
832
+ * @returns {Promise<void>}
833
+ */
834
+ percentage(level: number): Promise<void>;
835
+ }
836
+ /**
837
+ * Class representing a WoIOSensorTH device.
838
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md#outdoor-temperaturehumidity-sensor
839
+ */
840
+ export declare class WoIOSensorTH extends SwitchbotDevice {
841
+ /**
842
+ * Parses the service data for WoIOSensorTH.
843
+ * @param {Buffer} serviceData - The service data buffer.
844
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
845
+ * @param {Function} emitLog - The function to emit log messages.
846
+ * @returns {Promise<outdoorMeterServiceData | null>} - Parsed service data or null if invalid.
847
+ */
848
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<outdoorMeterServiceData | null>;
849
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
850
+ }
851
+ /**
852
+ * Class representing a WoKeypad device.
853
+ */
854
+ export declare class WoKeypad extends SwitchbotDevice {
855
+ /**
856
+ * Parses the service data for WoKeypad.
857
+ * @param {Buffer} serviceData - The service data buffer.
858
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
859
+ * @param {Function} emitLog - The function to emit log messages.
860
+ * @returns {Promise<keypadDetectorServiceData | null>} - Parsed service data or null if invalid.
861
+ */
862
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<keypadDetectorServiceData | null>;
863
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
864
+ }
865
+ /**
866
+ * Class representing a WoLeak device.
867
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md#outdoor-temperaturehumidity-sensor
868
+ */
869
+ export declare class WoLeak extends SwitchbotDevice {
870
+ /**
871
+ * Parses the service data for WoLeak.
872
+ * @param {Buffer} serviceData - The service data buffer.
873
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
874
+ * @param {Function} emitLog - The function to emit log messages.
875
+ * @returns {Promise<leakServiceData | null>} - Parsed service data or null if invalid.
876
+ */
877
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<waterLeakDetectorServiceData | null>;
878
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
879
+ }
880
+ /**
881
+ * Class representing a WoPlugMini device.
882
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/plugmini.md
883
+ */
884
+ export declare class WoPlugMiniJP extends SwitchbotDevice {
885
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
886
+ /**
887
+ * Parses the service data for WoPlugMini JP.
888
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
889
+ * @param {Function} emitLog - The function to emit log messages.
890
+ * @returns {Promise<plugMiniJPServiceData | null>} - Parsed service data or null if invalid.
891
+ */
892
+ static parseServiceData(manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<plugMiniJPServiceData | null>;
893
+ /**
894
+ * Reads the state of the plug.
895
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
896
+ */
897
+ readState(): Promise<boolean>;
898
+ /**
899
+ * Sets the state of the plug.
900
+ * @private
901
+ * @param {number[]} reqByteArray - The request byte array.
902
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
903
+ */
904
+ setState(reqByteArray: number[]): Promise<boolean>;
905
+ /**
906
+ * Turns on the plug.
907
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
908
+ */
909
+ turnOn(): Promise<boolean>;
910
+ /**
911
+ * Turns off the plug.
912
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
913
+ */
914
+ turnOff(): Promise<boolean>;
915
+ /**
916
+ * Toggles the state of the plug.
917
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
918
+ */
919
+ toggle(): Promise<boolean>;
920
+ /**
921
+ * Operates the plug with the given bytes.
922
+ * @param {number[]} bytes - The byte array to send to the plug.
923
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
924
+ */
925
+ operatePlug(bytes: number[]): Promise<boolean>;
926
+ }
927
+ /**
928
+ * Class representing a WoPlugMini device.
929
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/plugmini.md
930
+ */
931
+ export declare class WoPlugMiniUS extends SwitchbotDevice {
932
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
933
+ /**
934
+ * Parses the service data for WoPlugMini US.
935
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
936
+ * @param {Function} emitLog - The function to emit log messages.
937
+ * @returns {Promise<plugMiniUSServiceData | null>} - Parsed service data or null if invalid.
938
+ */
939
+ static parseServiceData(manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<plugMiniUSServiceData | null>;
940
+ /**
941
+ * Reads the state of the plug.
942
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
943
+ */
944
+ readState(): Promise<boolean>;
945
+ /**
946
+ * Sets the state of the plug.
947
+ * @private
948
+ * @param {number[]} reqByteArray - The request byte array.
949
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
950
+ */
951
+ private setState;
952
+ /**
953
+ * Turns on the plug.
954
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
955
+ */
956
+ turnOn(): Promise<boolean>;
957
+ /**
958
+ * Turns off the plug.
959
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
960
+ */
961
+ turnOff(): Promise<boolean>;
962
+ /**
963
+ * Toggles the state of the plug.
964
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
965
+ */
966
+ toggle(): Promise<boolean>;
967
+ /**
968
+ * Operates the plug with the given bytes.
969
+ * @param {number[]} bytes - The byte array to send to the plug.
970
+ * @returns {Promise<boolean>} - Resolves with a boolean that tells whether the plug is ON (true) or OFF (false).
971
+ */
972
+ operatePlug(bytes: number[]): Promise<boolean>;
973
+ }
974
+ /**
975
+ * Class representing a WoPresence device.
976
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md
977
+ */
978
+ export declare class WoPresence extends SwitchbotDevice {
979
+ /**
980
+ * Parses the service data for WoPresence.
981
+ * @param {Buffer} serviceData - The service data buffer.
982
+ * @param {Function} emitLog - The function to emit log messages.
983
+ * @returns {Promise<motionSensorServiceData | null>} - Parsed service data or null if invalid.
984
+ */
985
+ static parseServiceData(serviceData: Buffer, emitLog: (level: string, message: string) => void): Promise<motionSensorServiceData | null>;
986
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
987
+ }
988
+ /**
989
+ * Class representing a WoRelaySwitch1 device.
990
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/
991
+ */
992
+ export declare class WoRelaySwitch1 extends SwitchbotDevice {
993
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
994
+ /**
995
+ * Parses the service data for WoRelaySwitch1.
996
+ * @param {Buffer} serviceData - The service data buffer.
997
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
998
+ * @param {Function} emitLog - The function to emit log messages.
999
+ * @returns {Promise<relaySwitch1ServiceData | null>} - Parsed service data or null if invalid.
1000
+ */
1001
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<relaySwitch1ServiceData | null>;
1002
+ /**
1003
+ * Sends a command to the bot.
1004
+ * @param {Buffer} reqBuf - The command buffer.
1005
+ * @returns {Promise<void>}
1006
+ */
1007
+ protected sendCommand(reqBuf: Buffer): Promise<void>;
1008
+ /**
1009
+ * Turns on the bot.
1010
+ * @returns {Promise<void>}
1011
+ */
1012
+ turnOn(): Promise<void>;
1013
+ /**
1014
+ * Turns off the bot.
1015
+ * @returns {Promise<void>}
1016
+ */
1017
+ turnOff(): Promise<void>;
1018
+ }
1019
+ /**
1020
+ * Class representing a WoRelaySwitch1PM device.
1021
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/
1022
+ */
1023
+ export declare class WoRelaySwitch1PM extends SwitchbotDevice {
1024
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
1025
+ /**
1026
+ * Parses the service data for WoRelaySwitch1PM.
1027
+ * @param {Buffer} serviceData - The service data buffer.
1028
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
1029
+ * @param {Function} emitLog - The function to emit log messages.
1030
+ * @returns {Promise<relaySwitch1PMServiceData | null>} - Parsed service data or null if invalid.
1031
+ */
1032
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<relaySwitch1PMServiceData | null>;
1033
+ /**
1034
+ * Sends a command to the bot.
1035
+ * @param {Buffer} reqBuf - The command buffer.
1036
+ * @returns {Promise<void>}
1037
+ */
1038
+ protected sendCommand(reqBuf: Buffer): Promise<void>;
1039
+ /**
1040
+ * Turns on the bot.
1041
+ * @returns {Promise<void>}
1042
+ */
1043
+ turnOn(): Promise<void>;
1044
+ /**
1045
+ * Turns off the bot.
1046
+ * @returns {Promise<void>}
1047
+ */
1048
+ turnOff(): Promise<void>;
1049
+ }
1050
+ /**
1051
+ * Class representing a WoRemote device.
1052
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/
1053
+ */
1054
+ export declare class WoRemote extends SwitchbotDevice {
1055
+ /**
1056
+ * Parses the service data for WoRemote.
1057
+ * @param {Buffer} serviceData - The service data buffer.
1058
+ * @param {Function} emitLog - The function to emit log messages.
1059
+ * @returns {Promise<remoteServiceData | null>} - Parsed service data or null if invalid.
1060
+ */
1061
+ static parseServiceData(serviceData: Buffer, emitLog: (level: string, message: string) => void): Promise<remoteServiceData | null>;
1062
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
1063
+ }
1064
+ /**
1065
+ * Class representing a WoSensorTH device.
1066
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md
1067
+ */
1068
+ export declare class WoSensorTH extends SwitchbotDevice {
1069
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
1070
+ static parseServiceData(serviceData: Buffer, emitLog: (level: string, message: string) => void): Promise<meterServiceData | null>;
1071
+ }
1072
+ /**
1073
+ * Class representing a WoSensorTH device.
1074
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md
1075
+ */
1076
+ export declare class WoSensorTHPlus extends SwitchbotDevice {
1077
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
1078
+ static parseServiceData(serviceData: Buffer, emitLog: (level: string, message: string) => void): Promise<meterPlusServiceData | null>;
1079
+ }
1080
+ /**
1081
+ * Class representing a WoSensorTH device.
1082
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md
1083
+ */
1084
+ export declare class WoSensorTHPro extends SwitchbotDevice {
1085
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
1086
+ static parseServiceData(serviceData: Buffer, emitLog: (level: string, message: string) => void): Promise<meterProServiceData | null>;
1087
+ }
1088
+ /**
1089
+ * Class representing a WoSensorTH device.
1090
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md
1091
+ */
1092
+ export declare class WoSensorTHProCO2 extends SwitchbotDevice {
1093
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
1094
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<meterProCO2ServiceData | null>;
1095
+ }
1096
+ /**
1097
+ * Class representing a WoSmartLock device.
1098
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/lock.md
1099
+ */
1100
+ export declare class WoSmartLock extends SwitchbotDevice {
1101
+ iv: Buffer | null;
1102
+ key_id: string;
1103
+ encryption_key: Buffer | null;
1104
+ static Result: {
1105
+ ERROR: number;
1106
+ SUCCESS: number;
1107
+ SUCCESS_LOW_BATTERY: number;
1108
+ };
1109
+ static validateResponse(res: Buffer): Promise<number>;
1110
+ static getLockStatus(code: number): string;
1111
+ /**
1112
+ * Parses the service data from the SwitchBot Strip Light.
1113
+ * @param {Buffer} serviceData - The service data buffer.
1114
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
1115
+ * @param {Function} emitLog - The function to emit log messages.
1116
+ * @returns {Promise<lockServiceData | null>} - Parsed service data or null if invalid.
1117
+ */
1118
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<lockServiceData | null>;
1119
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
1120
+ /**
1121
+ * Initializes the encryption key info for valid lock communication.
1122
+ * @param {string} keyId - The key ID.
1123
+ * @param {string} encryptionKey - The encryption key.
1124
+ */
1125
+ setKey(keyId: string, encryptionKey: string): Promise<void>;
1126
+ /**
1127
+ * Unlocks the Smart Lock.
1128
+ * @returns {Promise<number>} - The result of the unlock operation.
1129
+ */
1130
+ unlock(): Promise<number>;
1131
+ /**
1132
+ * Unlocks the Smart Lock without unlatching the door.
1133
+ * @returns {Promise<number>} - The result of the unlock operation.
1134
+ */
1135
+ unlockNoUnlatch(): Promise<number>;
1136
+ /**
1137
+ * Locks the Smart Lock.
1138
+ * @returns {Promise<number>} - The result of the lock operation.
1139
+ */
1140
+ lock(): Promise<number>;
1141
+ /**
1142
+ * Gets general state info from the Smart Lock.
1143
+ * @returns {Promise<object | null>} - The state object or null if an error occurred.
1144
+ */
1145
+ info(): Promise<object | null>;
1146
+ /**
1147
+ * Encrypts a string using AES-128-CTR.
1148
+ * @param {string} str - The string to encrypt.
1149
+ * @returns {Promise<string>} - The encrypted string in hex format.
1150
+ */
1151
+ encrypt(str: string): Promise<string>;
1152
+ /**
1153
+ * Decrypts a buffer using AES-128-CTR.
1154
+ * @param {Buffer} data - The data to decrypt.
1155
+ * @returns {Promise<Buffer>} - The decrypted data.
1156
+ */
1157
+ decrypt(data: Buffer): Promise<Buffer>;
1158
+ /**
1159
+ * Retrieves the IV from the device.
1160
+ * @returns {Promise<Buffer>} - The IV buffer.
1161
+ */
1162
+ getIv(): Promise<Buffer>;
1163
+ /**
1164
+ * Sends an encrypted command to the device.
1165
+ * @param {string} key - The command key.
1166
+ * @returns {Promise<Buffer>} - The response buffer.
1167
+ */
1168
+ encryptedCommand(key: string): Promise<Buffer>;
1169
+ /**
1170
+ * Operates the lock with the given command.
1171
+ * @param {string} key - The command key.
1172
+ * @param {boolean} [encrypt] - Whether to encrypt the command.
1173
+ * @returns {Promise<Buffer>} - The response buffer.
1174
+ */
1175
+ operateLock(key: string, encrypt?: boolean): Promise<Buffer>;
1176
+ }
1177
+ /**
1178
+ * Class representing a WoSmartLockPro device.
1179
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/lock.md
1180
+ */
1181
+ export declare class WoSmartLockPro extends SwitchbotDevice {
1182
+ iv: Buffer | null;
1183
+ key_id: string;
1184
+ encryption_key: Buffer | null;
1185
+ static Result: {
1186
+ ERROR: number;
1187
+ SUCCESS: number;
1188
+ SUCCESS_LOW_BATTERY: number;
1189
+ };
1190
+ static validateResponse(res: Buffer): Promise<number>;
1191
+ static getLockStatus(code: number): string;
1192
+ /**
1193
+ * Parses the service data from the SwitchBot Strip Light.
1194
+ * @param {Buffer} serviceData - The service data buffer.
1195
+ * @param {Buffer} manufacturerData - The manufacturer data buffer.
1196
+ * @param {Function} emitLog - The function to emit log messages.
1197
+ * @returns {Promise<lockProServiceData | null>} - Parsed service data or null if invalid.
1198
+ */
1199
+ static parseServiceData(serviceData: Buffer, manufacturerData: Buffer, emitLog: (level: string, message: string) => void): Promise<lockProServiceData | null>;
1200
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
1201
+ /**
1202
+ * Initializes the encryption key info for valid lock communication.
1203
+ * @param {string} keyId - The key ID.
1204
+ * @param {string} encryptionKey - The encryption key.
1205
+ */
1206
+ setKey(keyId: string, encryptionKey: string): Promise<void>;
1207
+ /**
1208
+ * Unlocks the Smart Lock.
1209
+ * @returns {Promise<number>} - The result of the unlock operation.
1210
+ */
1211
+ unlock(): Promise<number>;
1212
+ /**
1213
+ * Unlocks the Smart Lock without unlatching the door.
1214
+ * @returns {Promise<number>} - The result of the unlock operation.
1215
+ */
1216
+ unlockNoUnlatch(): Promise<number>;
1217
+ /**
1218
+ * Locks the Smart Lock.
1219
+ * @returns {Promise<number>} - The result of the lock operation.
1220
+ */
1221
+ lock(): Promise<number>;
1222
+ /**
1223
+ * Gets general state info from the Smart Lock.
1224
+ * @returns {Promise<object | null>} - The state object or null if an error occurred.
1225
+ */
1226
+ info(): Promise<object | null>;
1227
+ /**
1228
+ * Encrypts a string using AES-128-CTR.
1229
+ * @param {string} str - The string to encrypt.
1230
+ * @returns {Promise<string>} - The encrypted string in hex format.
1231
+ */
1232
+ encrypt(str: string): Promise<string>;
1233
+ /**
1234
+ * Decrypts a buffer using AES-128-CTR.
1235
+ * @param {Buffer} data - The data to decrypt.
1236
+ * @returns {Promise<Buffer>} - The decrypted data.
1237
+ */
1238
+ decrypt(data: Buffer): Promise<Buffer>;
1239
+ /**
1240
+ * Retrieves the IV from the device.
1241
+ * @returns {Promise<Buffer>} - The IV buffer.
1242
+ */
1243
+ getIv(): Promise<Buffer>;
1244
+ /**
1245
+ * Sends an encrypted command to the device.
1246
+ * @param {string} key - The command key.
1247
+ * @returns {Promise<Buffer>} - The response buffer.
1248
+ */
1249
+ encryptedCommand(key: string): Promise<Buffer>;
1250
+ /**
1251
+ * Operates the lock with the given command.
1252
+ * @param {string} key - The command key.
1253
+ * @param {boolean} [encrypt] - Whether to encrypt the command.
1254
+ * @returns {Promise<Buffer>} - The response buffer.
1255
+ */
1256
+ operateLockPro(key: string, encrypt?: boolean): Promise<Buffer>;
1257
+ }
1258
+ /**
1259
+ * Class representing a WoStrip device.
1260
+ * @see https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/ledstriplight.md
1261
+ */
1262
+ export declare class WoStrip extends SwitchbotDevice {
1263
+ /**
1264
+ * Parses the service data from the SwitchBot Strip Light.
1265
+ * @param {Buffer} serviceData - The service data buffer.
1266
+ * @param {Function} emitLog - The function to emit log messages.
1267
+ * @returns {Promise<stripLightServiceData | null>} - Parsed service data or null if invalid.
1268
+ */
1269
+ static parseServiceData(serviceData: Buffer, emitLog: (level: string, message: string) => void): Promise<stripLightServiceData | null>;
1270
+ constructor(peripheral: NobleTypes['peripheral'], noble: NobleTypes['noble']);
1271
+ /**
1272
+ * Reads the state of the strip light.
1273
+ * @returns {Promise<boolean>} - Resolves with true if the strip light is ON, false otherwise.
1274
+ */
1275
+ readState(): Promise<boolean>;
1276
+ /**
1277
+ * Sets the state of the strip light.
1278
+ * @public
1279
+ * @param {number[]} reqByteArray - The request byte array.
1280
+ * @returns {Promise<boolean>} - Resolves with true if the operation was successful.
1281
+ */
1282
+ setState(reqByteArray: number[]): Promise<boolean>;
1283
+ /**
1284
+ * Turns the strip light on.
1285
+ * @returns {Promise<boolean>} - Resolves with true if the strip light is ON.
1286
+ */
1287
+ turnOn(): Promise<boolean>;
1288
+ /**
1289
+ * Turns the strip light off.
1290
+ * @returns {Promise<boolean>} - Resolves with true if the strip light is OFF.
1291
+ */
1292
+ turnOff(): Promise<boolean>;
1293
+ /**
1294
+ * Sets the brightness of the strip light.
1295
+ * @param {number} brightness - The brightness percentage (0-100).
1296
+ * @returns {Promise<boolean>} - Resolves with true if the operation was successful.
1297
+ */
1298
+ setBrightness(brightness: number): Promise<boolean>;
1299
+ /**
1300
+ * Sets the RGB values of the strip light.
1301
+ * @param {number} brightness - The brightness percentage (0-100).
1302
+ * @param {number} red - The red value (0-255).
1303
+ * @param {number} green - The green value (0-255).
1304
+ * @param {number} blue - The blue value (0-255).
1305
+ * @returns {Promise<boolean>} - Resolves with true if the operation was successful.
1306
+ */
1307
+ setRGB(brightness: number, red: number, green: number, blue: number): Promise<boolean>;
1308
+ /**
1309
+ * Operates the strip light with the given byte array.
1310
+ * @public
1311
+ * @param {number[]} bytes - The byte array to send.
1312
+ * @returns {Promise<boolean>} - Resolves with true if the operation was successful.
1313
+ */
1314
+ operateStripLight(bytes: number[]): Promise<boolean>;
1315
+ }
1316
+ export {};
126
1317
  //# sourceMappingURL=device.d.ts.map