node-switchbot 3.6.6 → 4.0.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 (551) hide show
  1. package/.github/npm-version-script-esm.js +97 -0
  2. package/CHANGELOG.md +322 -0
  3. package/PRODUCTION_READY.md +135 -0
  4. package/README.md +92 -0
  5. package/dist/api.d.ts +130 -0
  6. package/dist/api.d.ts.map +1 -0
  7. package/dist/api.js +286 -0
  8. package/dist/api.js.map +1 -0
  9. package/dist/ble.d.ts +116 -0
  10. package/dist/ble.d.ts.map +1 -0
  11. package/dist/ble.js +430 -0
  12. package/dist/ble.js.map +1 -0
  13. package/dist/devices/base.d.ts +146 -0
  14. package/dist/devices/base.d.ts.map +1 -0
  15. package/dist/devices/base.js +324 -0
  16. package/dist/devices/base.js.map +1 -0
  17. package/dist/devices/index.d.ts +30 -0
  18. package/dist/devices/index.d.ts.map +1 -0
  19. package/dist/devices/index.js +34 -0
  20. package/dist/devices/index.js.map +1 -0
  21. package/dist/devices/wo-air-purifier-table.d.ts +8 -0
  22. package/dist/devices/wo-air-purifier-table.d.ts.map +1 -0
  23. package/dist/devices/wo-air-purifier-table.js +12 -0
  24. package/dist/devices/wo-air-purifier-table.js.map +1 -0
  25. package/dist/devices/wo-air-purifier.d.ts +28 -0
  26. package/dist/devices/wo-air-purifier.d.ts.map +1 -0
  27. package/dist/devices/wo-air-purifier.js +105 -0
  28. package/dist/devices/wo-air-purifier.js.map +1 -0
  29. package/dist/devices/wo-blind-tilt.d.ts +36 -0
  30. package/dist/devices/wo-blind-tilt.d.ts.map +1 -0
  31. package/dist/devices/wo-blind-tilt.js +95 -0
  32. package/dist/devices/wo-blind-tilt.js.map +1 -0
  33. package/dist/devices/wo-bulb.d.ts +32 -0
  34. package/dist/devices/wo-bulb.d.ts.map +1 -0
  35. package/dist/devices/wo-bulb.js +109 -0
  36. package/dist/devices/wo-bulb.js.map +1 -0
  37. package/dist/devices/wo-ceiling-light.d.ts +8 -0
  38. package/dist/devices/wo-ceiling-light.d.ts.map +1 -0
  39. package/dist/devices/wo-ceiling-light.js +12 -0
  40. package/dist/devices/wo-ceiling-light.js.map +1 -0
  41. package/dist/devices/wo-contact.d.ts +12 -0
  42. package/dist/devices/wo-contact.d.ts.map +1 -0
  43. package/dist/devices/wo-contact.js +50 -0
  44. package/dist/devices/wo-contact.js.map +1 -0
  45. package/dist/devices/wo-curtain.d.ts +28 -0
  46. package/dist/devices/wo-curtain.d.ts.map +1 -0
  47. package/dist/devices/wo-curtain.js +82 -0
  48. package/dist/devices/wo-curtain.js.map +1 -0
  49. package/dist/devices/wo-hand.d.ts +24 -0
  50. package/dist/devices/wo-hand.d.ts.map +1 -0
  51. package/dist/devices/wo-hand.js +70 -0
  52. package/dist/devices/wo-hand.js.map +1 -0
  53. package/dist/devices/wo-hub2.d.ts +12 -0
  54. package/dist/devices/wo-hub2.d.ts.map +1 -0
  55. package/dist/devices/wo-hub2.js +48 -0
  56. package/dist/devices/wo-hub2.js.map +1 -0
  57. package/dist/devices/wo-hub3.d.ts +8 -0
  58. package/dist/devices/wo-hub3.d.ts.map +1 -0
  59. package/dist/devices/wo-hub3.js +12 -0
  60. package/dist/devices/wo-hub3.js.map +1 -0
  61. package/dist/devices/wo-humi.d.ts +28 -0
  62. package/dist/devices/wo-humi.d.ts.map +1 -0
  63. package/dist/devices/wo-humi.js +91 -0
  64. package/dist/devices/wo-humi.js.map +1 -0
  65. package/dist/devices/wo-humi2.d.ts +8 -0
  66. package/dist/devices/wo-humi2.d.ts.map +1 -0
  67. package/dist/devices/wo-humi2.js +12 -0
  68. package/dist/devices/wo-humi2.js.map +1 -0
  69. package/dist/devices/wo-io-sensor-th.d.ts +8 -0
  70. package/dist/devices/wo-io-sensor-th.d.ts.map +1 -0
  71. package/dist/devices/wo-io-sensor-th.js +12 -0
  72. package/dist/devices/wo-io-sensor-th.js.map +1 -0
  73. package/dist/devices/wo-keypad.d.ts +13 -0
  74. package/dist/devices/wo-keypad.d.ts.map +1 -0
  75. package/dist/devices/wo-keypad.js +46 -0
  76. package/dist/devices/wo-keypad.js.map +1 -0
  77. package/dist/devices/wo-leak.d.ts +12 -0
  78. package/dist/devices/wo-leak.d.ts.map +1 -0
  79. package/dist/devices/wo-leak.js +46 -0
  80. package/dist/devices/wo-leak.js.map +1 -0
  81. package/dist/devices/wo-lock-pro.d.ts +24 -0
  82. package/dist/devices/wo-lock-pro.d.ts.map +1 -0
  83. package/dist/devices/wo-lock-pro.js +72 -0
  84. package/dist/devices/wo-lock-pro.js.map +1 -0
  85. package/dist/devices/wo-lock.d.ts +20 -0
  86. package/dist/devices/wo-lock.d.ts.map +1 -0
  87. package/dist/devices/wo-lock.js +64 -0
  88. package/dist/devices/wo-lock.js.map +1 -0
  89. package/dist/devices/wo-plug-mini-jp.d.ts +8 -0
  90. package/dist/devices/wo-plug-mini-jp.d.ts.map +1 -0
  91. package/dist/devices/wo-plug-mini-jp.js +12 -0
  92. package/dist/devices/wo-plug-mini-jp.js.map +1 -0
  93. package/dist/devices/wo-plug-mini-us.d.ts +24 -0
  94. package/dist/devices/wo-plug-mini-us.d.ts.map +1 -0
  95. package/dist/devices/wo-plug-mini-us.js +70 -0
  96. package/dist/devices/wo-plug-mini-us.js.map +1 -0
  97. package/dist/devices/wo-presence.d.ts +12 -0
  98. package/dist/devices/wo-presence.d.ts.map +1 -0
  99. package/dist/devices/wo-presence.js +48 -0
  100. package/dist/devices/wo-presence.js.map +1 -0
  101. package/dist/devices/wo-relay-switch-1.d.ts +24 -0
  102. package/dist/devices/wo-relay-switch-1.d.ts.map +1 -0
  103. package/dist/devices/wo-relay-switch-1.js +70 -0
  104. package/dist/devices/wo-relay-switch-1.js.map +1 -0
  105. package/dist/devices/wo-relay-switch-1pm.d.ts +8 -0
  106. package/dist/devices/wo-relay-switch-1pm.d.ts.map +1 -0
  107. package/dist/devices/wo-relay-switch-1pm.js +12 -0
  108. package/dist/devices/wo-relay-switch-1pm.js.map +1 -0
  109. package/dist/devices/wo-remote.d.ts +13 -0
  110. package/dist/devices/wo-remote.d.ts.map +1 -0
  111. package/dist/devices/wo-remote.js +45 -0
  112. package/dist/devices/wo-remote.js.map +1 -0
  113. package/dist/devices/wo-sensor-th-plus.d.ts +8 -0
  114. package/dist/devices/wo-sensor-th-plus.d.ts.map +1 -0
  115. package/dist/devices/wo-sensor-th-plus.js +12 -0
  116. package/dist/devices/wo-sensor-th-plus.js.map +1 -0
  117. package/dist/devices/wo-sensor-th-pro-co2.d.ts +8 -0
  118. package/dist/devices/wo-sensor-th-pro-co2.d.ts.map +1 -0
  119. package/dist/devices/wo-sensor-th-pro-co2.js +12 -0
  120. package/dist/devices/wo-sensor-th-pro-co2.js.map +1 -0
  121. package/dist/devices/wo-sensor-th-pro.d.ts +8 -0
  122. package/dist/devices/wo-sensor-th-pro.d.ts.map +1 -0
  123. package/dist/devices/wo-sensor-th-pro.js +12 -0
  124. package/dist/devices/wo-sensor-th-pro.js.map +1 -0
  125. package/dist/devices/wo-sensor-th.d.ts +12 -0
  126. package/dist/devices/wo-sensor-th.d.ts.map +1 -0
  127. package/dist/devices/wo-sensor-th.js +49 -0
  128. package/dist/devices/wo-sensor-th.js.map +1 -0
  129. package/dist/devices/wo-strip.d.ts +8 -0
  130. package/dist/devices/wo-strip.d.ts.map +1 -0
  131. package/dist/devices/wo-strip.js +12 -0
  132. package/dist/devices/wo-strip.js.map +1 -0
  133. package/dist/errors.d.ts +63 -0
  134. package/dist/errors.d.ts.map +1 -0
  135. package/dist/errors.js +103 -0
  136. package/dist/errors.js.map +1 -0
  137. package/dist/index.d.ts +10 -6
  138. package/dist/index.d.ts.map +1 -1
  139. package/dist/index.js +9 -10
  140. package/dist/index.js.map +1 -1
  141. package/dist/settings.d.ts +126 -47
  142. package/dist/settings.d.ts.map +1 -1
  143. package/dist/settings.js +214 -64
  144. package/dist/settings.js.map +1 -1
  145. package/dist/switchbot.d.ts +87 -0
  146. package/dist/switchbot.d.ts.map +1 -0
  147. package/dist/switchbot.js +422 -0
  148. package/dist/switchbot.js.map +1 -0
  149. package/dist/types/api.d.ts +187 -0
  150. package/dist/types/api.d.ts.map +1 -0
  151. package/dist/types/api.js +6 -0
  152. package/dist/types/api.js.map +1 -0
  153. package/dist/types/ble.d.ts +246 -348
  154. package/dist/types/ble.d.ts.map +1 -1
  155. package/dist/types/ble.js +94 -1
  156. package/dist/types/ble.js.map +1 -1
  157. package/dist/types/device.d.ts +209 -0
  158. package/dist/types/device.d.ts.map +1 -0
  159. package/dist/types/device.js +6 -0
  160. package/dist/types/device.js.map +1 -0
  161. package/dist/types/index.d.ts +115 -0
  162. package/dist/types/index.d.ts.map +1 -0
  163. package/dist/types/index.js +19 -0
  164. package/dist/types/index.js.map +1 -0
  165. package/dist/utils/index.d.ts +97 -0
  166. package/dist/utils/index.d.ts.map +1 -0
  167. package/dist/utils/index.js +206 -0
  168. package/dist/utils/index.js.map +1 -0
  169. package/docs/assets/hierarchy.js +1 -1
  170. package/docs/assets/highlight.css +20 -6
  171. package/docs/assets/icons.js +1 -1
  172. package/docs/assets/icons.svg +1 -1
  173. package/docs/assets/main.js +2 -2
  174. package/docs/assets/navigation.js +1 -1
  175. package/docs/assets/search.js +1 -1
  176. package/docs/assets/style.css +3 -3
  177. package/docs/classes/APIError.html +6 -0
  178. package/docs/classes/APINotAvailableError.html +4 -0
  179. package/docs/classes/BLEConnection.html +17 -0
  180. package/docs/classes/BLENotAvailableError.html +4 -0
  181. package/docs/classes/BLEScanner.html +15 -0
  182. package/docs/classes/CommandFailedError.html +6 -0
  183. package/docs/classes/ConnectionTimeoutError.html +5 -0
  184. package/docs/classes/DeviceManager.html +25 -0
  185. package/docs/classes/DeviceNotFoundError.html +4 -0
  186. package/docs/classes/DiscoveryError.html +5 -0
  187. package/docs/classes/OpenAPIClient.html +66 -0
  188. package/docs/classes/SwitchBot.html +22 -0
  189. package/docs/classes/SwitchBotDevice.html +28 -0
  190. package/docs/classes/SwitchBotError.html +4 -0
  191. package/docs/classes/ValidationError.html +5 -0
  192. package/docs/classes/WoAirPurifier.html +32 -80
  193. package/docs/classes/WoAirPurifierTable.html +36 -83
  194. package/docs/classes/WoBlindTilt.html +34 -73
  195. package/docs/classes/WoBulb.html +33 -85
  196. package/docs/classes/WoCeilingLight.html +38 -107
  197. package/docs/classes/WoContact.html +27 -52
  198. package/docs/classes/WoCurtain.html +32 -69
  199. package/docs/classes/WoHand.html +30 -59
  200. package/docs/classes/WoHub2.html +27 -52
  201. package/docs/classes/WoHub3.html +28 -52
  202. package/docs/classes/WoHumi.html +33 -65
  203. package/docs/classes/WoHumi2.html +36 -67
  204. package/docs/classes/WoIOSensorTH.html +28 -53
  205. package/docs/classes/WoKeypad.html +28 -52
  206. package/docs/classes/WoLeak.html +27 -53
  207. package/docs/classes/WoPlugMiniJP.html +34 -78
  208. package/docs/classes/WoPlugMiniUS.html +30 -75
  209. package/docs/classes/WoPresence.html +27 -60
  210. package/docs/classes/WoRelaySwitch1.html +31 -55
  211. package/docs/classes/WoRelaySwitch1PM.html +34 -57
  212. package/docs/classes/WoRemote.html +28 -52
  213. package/docs/classes/WoSensorTH.html +27 -46
  214. package/docs/classes/WoSensorTHPlus.html +28 -46
  215. package/docs/classes/WoSensorTHPro.html +28 -46
  216. package/docs/classes/WoSensorTHProCO2.html +28 -46
  217. package/docs/classes/WoSmartLock.html +29 -111
  218. package/docs/classes/WoSmartLockPro.html +31 -111
  219. package/docs/classes/WoStrip.html +38 -94
  220. package/docs/enums/LogLevel.html +4 -7
  221. package/docs/enums/SwitchBotBLEModel.html +11 -6
  222. package/docs/enums/SwitchBotBLEModelName.html +13 -6
  223. package/docs/functions/updateBaseURL.html +3 -3
  224. package/docs/hierarchy.html +1 -1
  225. package/docs/index.html +40 -6
  226. package/docs/interfaces/APICommandRequest.html +5 -0
  227. package/docs/interfaces/APICommandResponse.html +5 -0
  228. package/docs/interfaces/APIDevice.html +18 -0
  229. package/docs/interfaces/APIDeviceStatus.html +36 -0
  230. package/docs/interfaces/APIErrorResponse.html +5 -0
  231. package/docs/interfaces/APIResponse.html +5 -0
  232. package/docs/interfaces/AirPurifierCommands.html +5 -0
  233. package/docs/interfaces/AirPurifierServiceData.html +14 -0
  234. package/docs/interfaces/AirPurifierStatus.html +17 -0
  235. package/docs/interfaces/BLEAdvertisement.html +6 -0
  236. package/docs/interfaces/BLEScanOptions.html +10 -0
  237. package/docs/interfaces/BLEServiceData.html +10 -0
  238. package/docs/interfaces/BlindTiltCommands.html +7 -0
  239. package/docs/interfaces/BlindTiltServiceData.html +14 -0
  240. package/docs/interfaces/BlindTiltStatus.html +15 -0
  241. package/docs/interfaces/BotCommands.html +4 -0
  242. package/docs/interfaces/BotServiceData.html +12 -0
  243. package/docs/interfaces/BotStatus.html +14 -0
  244. package/docs/interfaces/BulbCommands.html +6 -0
  245. package/docs/interfaces/BulbServiceData.html +19 -0
  246. package/docs/interfaces/BulbStatus.html +16 -0
  247. package/docs/interfaces/CeilingLightCommands.html +6 -0
  248. package/docs/interfaces/CeilingLightServiceData.html +19 -0
  249. package/docs/interfaces/CeilingLightStatus.html +16 -0
  250. package/docs/interfaces/CommandResult.html +12 -0
  251. package/docs/interfaces/ContactServiceData.html +13 -0
  252. package/docs/interfaces/ContactStatus.html +15 -0
  253. package/docs/interfaces/CurtainCommands.html +5 -0
  254. package/docs/interfaces/CurtainServiceData.html +14 -0
  255. package/docs/interfaces/CurtainStatus.html +17 -0
  256. package/docs/interfaces/DeviceInfo.html +26 -0
  257. package/docs/interfaces/DeviceListResponse.html +4 -0
  258. package/docs/interfaces/DeviceStatus.html +12 -0
  259. package/docs/interfaces/DiscoveryOptions.html +14 -0
  260. package/docs/interfaces/HubServiceData.html +14 -0
  261. package/docs/interfaces/HubStatus.html +15 -0
  262. package/docs/interfaces/HumidifierCommands.html +5 -0
  263. package/docs/interfaces/HumidifierServiceData.html +14 -0
  264. package/docs/interfaces/HumidifierStatus.html +18 -0
  265. package/docs/interfaces/KeypadStatus.html +13 -0
  266. package/docs/interfaces/LeakServiceData.html +11 -0
  267. package/docs/interfaces/LeakStatus.html +13 -0
  268. package/docs/interfaces/LockCommands.html +3 -0
  269. package/docs/interfaces/LockServiceData.html +15 -0
  270. package/docs/interfaces/LockStatus.html +15 -0
  271. package/docs/interfaces/MeterServiceData.html +13 -0
  272. package/docs/interfaces/MeterStatus.html +15 -0
  273. package/docs/interfaces/MotionServiceData.html +13 -0
  274. package/docs/interfaces/MotionStatus.html +14 -0
  275. package/docs/interfaces/PlugCommands.html +4 -0
  276. package/docs/interfaces/PlugServiceData.html +17 -0
  277. package/docs/interfaces/PlugStatus.html +16 -0
  278. package/docs/interfaces/PresenceServiceData.html +12 -0
  279. package/docs/interfaces/PresenceStatus.html +14 -0
  280. package/docs/interfaces/RelaySwitchCommands.html +4 -0
  281. package/docs/interfaces/RelaySwitchServiceData.html +14 -0
  282. package/docs/interfaces/RelaySwitchStatus.html +16 -0
  283. package/docs/interfaces/RemoteStatus.html +12 -0
  284. package/docs/interfaces/SceneListResponse.html +3 -0
  285. package/docs/interfaces/StripCommands.html +6 -0
  286. package/docs/interfaces/StripServiceData.html +19 -0
  287. package/docs/interfaces/StripStatus.html +16 -0
  288. package/docs/interfaces/SwitchBotConfig.html +18 -0
  289. package/docs/interfaces/WebhookConfig.html +4 -0
  290. package/docs/interfaces/WebhookDetails.html +7 -0
  291. package/docs/interfaces/WebhookQueryResponse.html +5 -0
  292. package/docs/interfaces/WebhookSetupResponse.html +5 -0
  293. package/docs/modules.html +1 -1
  294. package/docs/types/ConnectionType.html +2 -0
  295. package/docs/types/PhysicalDeviceType.html +2 -0
  296. package/docs/types/VirtualDeviceType.html +2 -0
  297. package/docs/variables/urls.html +1 -1
  298. package/package.json +12 -21
  299. package/.github/scripts/npm-version-script-esm-auto.js +0 -207
  300. package/dist/device.d.ts +0 -1626
  301. package/dist/device.d.ts.map +0 -1
  302. package/dist/device.js +0 -3602
  303. package/dist/device.js.map +0 -1
  304. package/dist/device.test.d.ts +0 -2
  305. package/dist/device.test.d.ts.map +0 -1
  306. package/dist/device.test.js +0 -336
  307. package/dist/device.test.js.map +0 -1
  308. package/dist/index.test.d.ts +0 -2
  309. package/dist/index.test.d.ts.map +0 -1
  310. package/dist/index.test.js +0 -14
  311. package/dist/index.test.js.map +0 -1
  312. package/dist/parameter-checker.d.ts +0 -91
  313. package/dist/parameter-checker.d.ts.map +0 -1
  314. package/dist/parameter-checker.js +0 -262
  315. package/dist/parameter-checker.js.map +0 -1
  316. package/dist/parameter-checker.test.d.ts +0 -2
  317. package/dist/parameter-checker.test.d.ts.map +0 -1
  318. package/dist/parameter-checker.test.js +0 -56
  319. package/dist/parameter-checker.test.js.map +0 -1
  320. package/dist/settings.test.d.ts +0 -2
  321. package/dist/settings.test.d.ts.map +0 -1
  322. package/dist/settings.test.js +0 -61
  323. package/dist/settings.test.js.map +0 -1
  324. package/dist/switchbot-ble.d.ts +0 -89
  325. package/dist/switchbot-ble.d.ts.map +0 -1
  326. package/dist/switchbot-ble.js +0 -320
  327. package/dist/switchbot-ble.js.map +0 -1
  328. package/dist/switchbot-ble.test.d.ts +0 -2
  329. package/dist/switchbot-ble.test.d.ts.map +0 -1
  330. package/dist/switchbot-ble.test.js +0 -32
  331. package/dist/switchbot-ble.test.js.map +0 -1
  332. package/dist/switchbot-openapi.d.ts +0 -139
  333. package/dist/switchbot-openapi.d.ts.map +0 -1
  334. package/dist/switchbot-openapi.js +0 -375
  335. package/dist/switchbot-openapi.js.map +0 -1
  336. package/dist/switchbot-openapi.test.d.ts +0 -2
  337. package/dist/switchbot-openapi.test.d.ts.map +0 -1
  338. package/dist/switchbot-openapi.test.js +0 -36
  339. package/dist/switchbot-openapi.test.js.map +0 -1
  340. package/dist/types/ble-guards.d.ts +0 -12
  341. package/dist/types/ble-guards.d.ts.map +0 -1
  342. package/dist/types/ble-guards.js +0 -10
  343. package/dist/types/ble-guards.js.map +0 -1
  344. package/dist/types/ble-guards.test.d.ts +0 -2
  345. package/dist/types/ble-guards.test.d.ts.map +0 -1
  346. package/dist/types/ble-guards.test.js +0 -62
  347. package/dist/types/ble-guards.test.js.map +0 -1
  348. package/dist/types/openapi.d.ts +0 -638
  349. package/dist/types/openapi.d.ts.map +0 -1
  350. package/dist/types/openapi.js +0 -3
  351. package/dist/types/openapi.js.map +0 -1
  352. package/docs/classes/Advertising.html +0 -21
  353. package/docs/classes/ErrorUtils.html +0 -25
  354. package/docs/classes/ParameterChecker.html +0 -69
  355. package/docs/classes/SwitchBotBLE.html +0 -39
  356. package/docs/classes/SwitchBotOpenAPI.html +0 -57
  357. package/docs/classes/SwitchbotDevice.html +0 -47
  358. package/docs/classes/ValidationUtils.html +0 -51
  359. package/docs/classes/WoPlugMiniEU.html +0 -84
  360. package/docs/classes/WoSmartLockUltra.html +0 -113
  361. package/docs/enums/SwitchBotBLEModelFriendlyName.html +0 -39
  362. package/docs/enums/SwitchBotModel.html +0 -53
  363. package/docs/interfaces/AdvertisementData.html +0 -3
  364. package/docs/interfaces/Chars.html +0 -4
  365. package/docs/interfaces/ColorLightServiceDataBase.html +0 -17
  366. package/docs/interfaces/ErrorObject.html +0 -3
  367. package/docs/interfaces/LockBaseServiceData.html +0 -15
  368. package/docs/interfaces/NobleTypes.html +0 -3
  369. package/docs/interfaces/Params.html +0 -6
  370. package/docs/interfaces/PlugMiniServiceDataBase.html +0 -12
  371. package/docs/interfaces/Rule.html +0 -9
  372. package/docs/interfaces/ServiceData.html +0 -2
  373. package/docs/interfaces/SwitchBotBLEDevice.html +0 -28
  374. package/docs/interfaces/SwitchBotScanner.html +0 -6
  375. package/docs/interfaces/TemperatureServiceDataBase.html +0 -10
  376. package/docs/interfaces/WebhookDetail.html +0 -6
  377. package/docs/interfaces/ad.html +0 -5
  378. package/docs/interfaces/body.html +0 -3
  379. package/docs/interfaces/bodyChange.html +0 -4
  380. package/docs/interfaces/deleteWebhookResponse.html +0 -4
  381. package/docs/interfaces/device.html +0 -7
  382. package/docs/interfaces/deviceList.html +0 -2
  383. package/docs/interfaces/deviceStatus.html +0 -7
  384. package/docs/interfaces/deviceStatusRequest.html +0 -4
  385. package/docs/interfaces/deviceWebhook.html +0 -4
  386. package/docs/interfaces/deviceWebhookContext.html +0 -4
  387. package/docs/interfaces/devices.html +0 -4
  388. package/docs/interfaces/infraredRemoteList.html +0 -2
  389. package/docs/interfaces/irdevice.html +0 -5
  390. package/docs/interfaces/pushRequest.html +0 -5
  391. package/docs/interfaces/pushResponse.html +0 -5
  392. package/docs/interfaces/pushResponseBody.html +0 -3
  393. package/docs/interfaces/queryWebhookResponse.html +0 -4
  394. package/docs/interfaces/setupWebhookResponse.html +0 -4
  395. package/docs/interfaces/updateWebhookResponse.html +0 -4
  396. package/docs/interfaces/webhookRequest.html +0 -4
  397. package/docs/types/BLEDeviceServiceData.html +0 -1
  398. package/docs/types/IndoorCam.html +0 -1
  399. package/docs/types/MacAddress.html +0 -1
  400. package/docs/types/airPurifier.html +0 -1
  401. package/docs/types/airPurifierPM25WebhookContext.html +0 -1
  402. package/docs/types/airPurifierServiceData.html +0 -1
  403. package/docs/types/airPurifierStatus.html +0 -1
  404. package/docs/types/airPurifierTable.html +0 -1
  405. package/docs/types/airPurifierTablePM25WebhookContext.html +0 -1
  406. package/docs/types/airPurifierTableServiceData.html +0 -1
  407. package/docs/types/airPurifierTableStatus.html +0 -1
  408. package/docs/types/airPurifierTableVOC.html +0 -1
  409. package/docs/types/airPurifierTableVOCStatus.html +0 -1
  410. package/docs/types/airPurifierTableVOCWebhookContext.html +0 -1
  411. package/docs/types/airPurifierTableWebhookContext.html +0 -1
  412. package/docs/types/airPurifierVOC.html +0 -1
  413. package/docs/types/airPurifierVOCStatus.html +0 -1
  414. package/docs/types/airPurifierVOCWebhookContext.html +0 -1
  415. package/docs/types/airPurifierWebhookContext.html +0 -1
  416. package/docs/types/batteryCirculatorFan.html +0 -1
  417. package/docs/types/batteryCirculatorFanServiceData.html +0 -1
  418. package/docs/types/batteryCirculatorFanStatus.html +0 -1
  419. package/docs/types/batteryCirculatorFanWebhookContext.html +0 -1
  420. package/docs/types/blindTilt.html +0 -1
  421. package/docs/types/blindTiltServiceData.html +0 -1
  422. package/docs/types/blindTiltStatus.html +0 -1
  423. package/docs/types/blindTiltWebhookContext.html +0 -1
  424. package/docs/types/bot.html +0 -1
  425. package/docs/types/botServiceData.html +0 -1
  426. package/docs/types/botStatus.html +0 -1
  427. package/docs/types/botWebhookContext.html +0 -1
  428. package/docs/types/ceilingLight.html +0 -1
  429. package/docs/types/ceilingLightPro.html +0 -1
  430. package/docs/types/ceilingLightProServiceData.html +0 -1
  431. package/docs/types/ceilingLightProStatus.html +0 -1
  432. package/docs/types/ceilingLightProWebhookContext.html +0 -1
  433. package/docs/types/ceilingLightServiceData.html +0 -1
  434. package/docs/types/ceilingLightStatus.html +0 -1
  435. package/docs/types/ceilingLightWebhookContext.html +0 -1
  436. package/docs/types/circulatorFanStatus.html +0 -1
  437. package/docs/types/circulatorFanWebhookContext.html +0 -1
  438. package/docs/types/colorBulb.html +0 -1
  439. package/docs/types/colorBulbServiceData.html +0 -1
  440. package/docs/types/colorBulbStatus.html +0 -1
  441. package/docs/types/colorBulbWebhookContext.html +0 -1
  442. package/docs/types/commandType.html +0 -2
  443. package/docs/types/contactSensor.html +0 -1
  444. package/docs/types/contactSensorServiceData.html +0 -1
  445. package/docs/types/contactSensorStatus.html +0 -1
  446. package/docs/types/contactSensorWebhookContext.html +0 -1
  447. package/docs/types/curtain.html +0 -1
  448. package/docs/types/curtain3.html +0 -1
  449. package/docs/types/curtain3ServiceData.html +0 -1
  450. package/docs/types/curtain3WebhookContext.html +0 -1
  451. package/docs/types/curtainServiceData.html +0 -1
  452. package/docs/types/curtainStatus.html +0 -1
  453. package/docs/types/curtainWebhookContext.html +0 -1
  454. package/docs/types/floorCleaningRobotS10.html +0 -1
  455. package/docs/types/floorCleaningRobotS10Status.html +0 -1
  456. package/docs/types/floorCleaningRobotS10WebhookContext.html +0 -1
  457. package/docs/types/hub2.html +0 -1
  458. package/docs/types/hub2ServiceData.html +0 -1
  459. package/docs/types/hub2Status.html +0 -1
  460. package/docs/types/hub2WebhookContext.html +0 -1
  461. package/docs/types/hub3ServiceData.html +0 -1
  462. package/docs/types/humidifier.html +0 -1
  463. package/docs/types/humidifier2ServiceData.html +0 -1
  464. package/docs/types/humidifier2Status.html +0 -1
  465. package/docs/types/humidifier2WebhookContext.html +0 -1
  466. package/docs/types/humidifierServiceData.html +0 -1
  467. package/docs/types/humidifierStatus.html +0 -1
  468. package/docs/types/humidifierWebhookContext.html +0 -1
  469. package/docs/types/indoorCameraWebhookContext.html +0 -1
  470. package/docs/types/keypad.html +0 -1
  471. package/docs/types/keypadDetectorServiceData.html +0 -1
  472. package/docs/types/keypadTouch.html +0 -1
  473. package/docs/types/keypadTouchWebhookContext.html +0 -1
  474. package/docs/types/keypadWebhookContext.html +0 -1
  475. package/docs/types/lock.html +0 -1
  476. package/docs/types/lockPro.html +0 -1
  477. package/docs/types/lockProServiceData.html +0 -1
  478. package/docs/types/lockProStatus.html +0 -1
  479. package/docs/types/lockProWebhookContext.html +0 -1
  480. package/docs/types/lockServiceData.html +0 -1
  481. package/docs/types/lockStatus.html +0 -1
  482. package/docs/types/lockWebhookContext.html +0 -1
  483. package/docs/types/meter.html +0 -1
  484. package/docs/types/meterPlus.html +0 -1
  485. package/docs/types/meterPlusServiceData.html +0 -1
  486. package/docs/types/meterPlusStatus.html +0 -1
  487. package/docs/types/meterPlusWebhookContext.html +0 -1
  488. package/docs/types/meterPro.html +0 -1
  489. package/docs/types/meterProCO2ServiceData.html +0 -1
  490. package/docs/types/meterProCO2Status.html +0 -1
  491. package/docs/types/meterProCO2WebhookContext.html +0 -1
  492. package/docs/types/meterProServiceData.html +0 -1
  493. package/docs/types/meterProStatus.html +0 -1
  494. package/docs/types/meterProWebhookContext.html +0 -1
  495. package/docs/types/meterServiceData.html +0 -1
  496. package/docs/types/meterStatus.html +0 -1
  497. package/docs/types/meterWebhookContext.html +0 -1
  498. package/docs/types/motionSensor.html +0 -1
  499. package/docs/types/motionSensorServiceData.html +0 -1
  500. package/docs/types/motionSensorStatus.html +0 -1
  501. package/docs/types/motionSensorWebhookContext.html +0 -1
  502. package/docs/types/onadvertisement.html +0 -1
  503. package/docs/types/ondiscover.html +0 -1
  504. package/docs/types/outdoorMeter.html +0 -1
  505. package/docs/types/outdoorMeterServiceData.html +0 -1
  506. package/docs/types/outdoorMeterStatus.html +0 -1
  507. package/docs/types/outdoorMeterWebhookContext.html +0 -1
  508. package/docs/types/panTiltCamWebhookContext.html +0 -1
  509. package/docs/types/pantiltCam.html +0 -1
  510. package/docs/types/pantiltCam2k.html +0 -1
  511. package/docs/types/plug.html +0 -1
  512. package/docs/types/plugMini.html +0 -1
  513. package/docs/types/plugMiniEUServiceData.html +0 -1
  514. package/docs/types/plugMiniEUWebhookContext.html +0 -1
  515. package/docs/types/plugMiniJPServiceData.html +0 -1
  516. package/docs/types/plugMiniJPWebhookContext.html +0 -1
  517. package/docs/types/plugMiniStatus.html +0 -1
  518. package/docs/types/plugMiniUSServiceData.html +0 -1
  519. package/docs/types/plugMiniUSWebhookContext.html +0 -1
  520. package/docs/types/plugStatus.html +0 -1
  521. package/docs/types/plugWebhookContext.html +0 -1
  522. package/docs/types/presenceSensor.html +0 -1
  523. package/docs/types/presenceSensorServiceData.html +0 -1
  524. package/docs/types/presenceSensorStatus.html +0 -1
  525. package/docs/types/presenceSensorWebhookContext.html +0 -1
  526. package/docs/types/relaySwitch1Context.html +0 -1
  527. package/docs/types/relaySwitch1PMContext.html +0 -1
  528. package/docs/types/relaySwitch1PMServiceData.html +0 -1
  529. package/docs/types/relaySwitch1PMStatus.html +0 -1
  530. package/docs/types/relaySwitch1ServiceData.html +0 -1
  531. package/docs/types/relaySwitch1Status.html +0 -1
  532. package/docs/types/remote.html +0 -1
  533. package/docs/types/remoteServiceData.html +0 -1
  534. package/docs/types/robotVacuumCleanerS1.html +0 -1
  535. package/docs/types/robotVacuumCleanerS1Plus.html +0 -1
  536. package/docs/types/robotVacuumCleanerS1PlusStatus.html +0 -1
  537. package/docs/types/robotVacuumCleanerS1PlusWebhookContext.html +0 -1
  538. package/docs/types/robotVacuumCleanerS1Status.html +0 -1
  539. package/docs/types/robotVacuumCleanerS1WebhookContext.html +0 -1
  540. package/docs/types/robotVacuumCleanerServiceData.html +0 -1
  541. package/docs/types/stripLight.html +0 -1
  542. package/docs/types/stripLightServiceData.html +0 -1
  543. package/docs/types/stripLightStatus.html +0 -1
  544. package/docs/types/stripLightWebhookContext.html +0 -1
  545. package/docs/types/waterLeakDetector.html +0 -1
  546. package/docs/types/waterLeakDetectorServiceData.html +0 -1
  547. package/docs/types/waterLeakDetectorStatus.html +0 -1
  548. package/docs/types/waterLeakDetectorWebhookContext.html +0 -1
  549. package/docs/variables/parameterChecker.html +0 -1
  550. package/eslint.config.js +0 -48
  551. package/typedoc.json +0 -17
@@ -1,57 +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>SwitchBotOpenAPI | 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">SwitchBotOpenAPI</a></li></ul><h1>Class SwitchBotOpenAPI</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>The <code>SwitchBotOpenAPI</code> class provides methods to interact with the SwitchBot OpenAPI.
2
- It allows you to retrieve device information, control devices, and manage webhooks.</p>
3
- </div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example">Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">switchBotAPI</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">SwitchBotOpenAPI</span><span class="hl-1">(</span><span class="hl-2">&#39;your-token&#39;</span><span class="hl-1">, </span><span class="hl-2">&#39;your-secret&#39;</span><span class="hl-1">);</span><br/><br/><span class="hl-5">// Get devices</span><br/><span class="hl-6">switchBotAPI</span><span class="hl-1">.</span><span class="hl-0">getDevices</span><span class="hl-1">().</span><span class="hl-0">then</span><span class="hl-1">(</span><span class="hl-6">response</span><span class="hl-1"> </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-6">response</span><span class="hl-1">);</span><br/><span class="hl-1">}).</span><span class="hl-0">catch</span><span class="hl-1">(</span><span class="hl-6">error</span><span class="hl-1"> </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-0">error</span><span class="hl-1">(</span><span class="hl-6">error</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">// Control a device</span><br/><span class="hl-6">switchBotAPI</span><span class="hl-1">.</span><span class="hl-0">controlDevice</span><span class="hl-1">(</span><span class="hl-2">&#39;device-id&#39;</span><span class="hl-1">, </span><span class="hl-2">&#39;turnOn&#39;</span><span class="hl-1">, </span><span class="hl-2">&#39;default&#39;</span><span class="hl-1">).</span><span class="hl-0">then</span><span class="hl-1">(</span><span class="hl-6">response</span><span class="hl-1"> </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-6">response</span><span class="hl-1">);</span><br/><span class="hl-1">}).</span><span class="hl-0">catch</span><span class="hl-1">(</span><span class="hl-6">error</span><span class="hl-1"> </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-0">error</span><span class="hl-1">(</span><span class="hl-6">error</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">// Setup webhook</span><br/><span class="hl-6">switchBotAPI</span><span class="hl-1">.</span><span class="hl-0">setupWebhook</span><span class="hl-1">(</span><span class="hl-2">&#39;http://your-webhook-url&#39;</span><span class="hl-1">).</span><span class="hl-0">then</span><span class="hl-1">(() </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">&#39;Webhook setup successfully&#39;</span><span class="hl-1">);</span><br/><span class="hl-1">}).</span><span class="hl-0">catch</span><span class="hl-1">(</span><span class="hl-6">error</span><span class="hl-1"> </span><span class="hl-3">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-0">error</span><span class="hl-1">(</span><span class="hl-6">error</span><span class="hl-1">);</span><br/><span class="hl-1">});</span>
4
- </code><button type="button">Copy</button></pre>
5
-
6
- </div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-token">Param: token<a href="#param-token" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>The API token used for authentication.</p>
7
- </div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-secret">Param: secret<a href="#param-secret" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>The secret key used for signing requests.</p>
8
- </div></div></section><section class="tsd-panel tsd-hierarchy" data-refl="2820"><h4>Hierarchy</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-signature-type">EventEmitter</span><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">SwitchBotOpenAPI</span></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/switchbot-openapi.ts#L62">src/switchbot-openapi.ts:62</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-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><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
9
- </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="#webhookeventlistener" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>webhook<wbr/>Event<wbr/>Listener?</span></a>
10
- </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="#controldevice" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>control<wbr/>Device</span></a>
11
- <a href="#deletewebhook" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>delete<wbr/>Webhook</span></a>
12
- <a href="#getdevices" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Devices</span></a>
13
- <a href="#getdevicestatus" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Device<wbr/>Status</span></a>
14
- <a href="#setupwebhook" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>setup<wbr/>Webhook</span></a>
15
- </div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructorswitchbotopenapi"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">SwitchBotOpenAPI</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">token</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">secret</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">hostname</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">SwitchBotOpenAPI</a><a href="#constructorswitchbotopenapi" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates an instance of the SwitchBot OpenAPI client.</p>
16
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">token</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The API token used for authentication.</p>
17
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">secret</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The secret key used for signing requests.</p>
18
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">hostname</span>: <span class="tsd-signature-type">string</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">SwitchBotOpenAPI</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Overrides EventEmitter.constructor</p><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/switchbot-openapi.ts#L74">src/switchbot-openapi.ts:74</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Properties</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="webhookeventlistener"><code class="tsd-tag">Optional</code><span>webhook<wbr/>Event<wbr/>Listener</span><a href="#webhookeventlistener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">webhookEventListener</span><span class="tsd-signature-symbol">?:</span><br/>    <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><br/>    <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Server</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-keyword">typeof</span> <span class="tsd-signature-type">IncomingMessage</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-keyword">typeof</span> <span class="tsd-signature-type">ServerResponse</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = null</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/switchbot-openapi.ts#L66">src/switchbot-openapi.ts:66</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Methods</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="controldevice"><span>control<wbr/>Device</span><a href="#controldevice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="controldevice-1"><span class="tsd-kind-call-signature">controlDevice</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">deviceId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">command</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">parameter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">commandType</span><span class="tsd-signature-symbol">?:</span> <a href="../types/commandType.html" class="tsd-signature-type tsd-kind-type-alias">commandType</a><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">token</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">secret</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">response</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/pushResponseBody.html" class="tsd-signature-type tsd-kind-interface">pushResponseBody</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">statusCode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">&gt;</span><a href="#controldevice-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Controls a device by sending a command to the SwitchBot API.</p>
19
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">deviceId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The ID of the device to control.</p>
20
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">command</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The command to send to the device.</p>
21
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">parameter</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The parameter for the command.</p>
22
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">commandType</span>: <a href="../types/commandType.html" class="tsd-signature-type tsd-kind-type-alias">commandType</a><span class="tsd-signature-symbol"> = &#39;command&#39;</span></span><div class="tsd-comment tsd-typography"><p>The type of the command (default is 'command').</p>
23
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">token</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>(Optional) The token used for authentication. If not provided, the instance token will be used.</p>
24
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">secret</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>(Optional) The secret used for authentication. If not provided, the instance secret will be used.</p>
25
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">response</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/pushResponseBody.html" class="tsd-signature-type tsd-kind-interface">pushResponseBody</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">statusCode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A promise that resolves to an object containing the response body and status code.</p>
26
- <div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws">Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>An error if the device control fails.</p>
27
- </div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/switchbot-openapi.ts#L162">src/switchbot-openapi.ts:162</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="deletewebhook"><span>delete<wbr/>Webhook</span><a href="#deletewebhook" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="deletewebhook-1"><span class="tsd-kind-call-signature">deleteWebhook</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">url</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">token</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">secret</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> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#deletewebhook-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Deletes a webhook by sending a request to the specified URL.</p>
28
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">url</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The URL of the webhook to be deleted.</p>
29
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">token</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>(Optional) The token used for authentication. If not provided, the instance token will be used.</p>
30
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">secret</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>(Optional) The secret used for authentication. If not provided, the instance secret will be used.</p>
31
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A promise that resolves when the webhook is successfully deleted.</p>
32
- <div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-1">Throws<a href="#throws-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Will log an error if the deletion fails.</p>
33
- </div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/switchbot-openapi.ts#L352">src/switchbot-openapi.ts:352</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getdevices"><span>get<wbr/>Devices</span><a href="#getdevices" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getdevices-1"><span class="tsd-kind-call-signature">getDevices</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">token</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">secret</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">response</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/devices.html" class="tsd-signature-type tsd-kind-interface">devices</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">statusCode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">&gt;</span><a href="#getdevices-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the list of devices from the SwitchBot OpenAPI.</p>
34
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">token</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>(Optional) The token used for authentication. If not provided, the instance token will be used.</p>
35
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">secret</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>(Optional) The secret used for authentication. If not provided, the instance secret will be used.</p>
36
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">response</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/devices.html" class="tsd-signature-type tsd-kind-interface">devices</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">statusCode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A promise that resolves to an object containing the API response.</p>
37
- <div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-2">Throws<a href="#throws-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Throws an error if the request to get devices fails.</p>
38
- </div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/switchbot-openapi.ts#L134">src/switchbot-openapi.ts:134</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getdevicestatus"><span>get<wbr/>Device<wbr/>Status</span><a href="#getdevicestatus" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getdevicestatus-1"><span class="tsd-kind-call-signature">getDeviceStatus</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">deviceId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">token</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">secret</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">response</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/deviceStatus.html" class="tsd-signature-type tsd-kind-interface">deviceStatus</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">statusCode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">&gt;</span><a href="#getdevicestatus-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the status of a specific device.</p>
39
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">deviceId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The unique identifier of the device.</p>
40
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">token</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>(Optional) The token used for authentication. If not provided, the instance token will be used.</p>
41
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">secret</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>(Optional) The secret used for authentication. If not provided, the instance secret will be used.</p>
42
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">response</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/deviceStatus.html" class="tsd-signature-type tsd-kind-interface">deviceStatus</a><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">statusCode</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A promise that resolves to an object containing the device status and the status code of the request.</p>
43
- <div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-3">Throws<a href="#throws-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>An error if the request fails.</p>
44
- </div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/switchbot-openapi.ts#L202">src/switchbot-openapi.ts:202</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="setupwebhook"><span>setup<wbr/>Webhook</span><a href="#setupwebhook" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="setupwebhook-1"><span class="tsd-kind-call-signature">setupWebhook</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">url</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">token</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">secret</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> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#setupwebhook-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sets up a webhook listener and configures the webhook on the server.</p>
45
- <p>This method performs the following steps:</p>
46
- <ol>
47
- <li>Creates a local server to listen for incoming webhook events.</li>
48
- <li>Sends a request to set up the webhook with the provided URL.</li>
49
- <li>Sends a request to update the webhook configuration.</li>
50
- <li>Sends a request to query the current webhook URL.</li>
51
- </ol>
52
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">url</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The URL to which the webhook events will be sent.</p>
53
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">token</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>(Optional) The token used for authentication. If not provided, the instance token will be used.</p>
54
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">secret</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>(Optional) The secret used for authentication. If not provided, the instance secret will be used.</p>
55
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A promise that resolves when the webhook setup is complete.</p>
56
- <div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-4">Throws<a href="#throws-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Will log an error if any step in the webhook setup process fails.</p>
57
- </div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/switchbot-openapi.ts#L233">src/switchbot-openapi.ts:233</a></li></ul></aside></div></li></ul></section></section></details></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><details open class="tsd-accordion tsd-page-navigation"><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>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#webhookeventlistener"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>webhook<wbr/>Event<wbr/>Listener</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#controldevice"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>control<wbr/>Device</span></a><a href="#deletewebhook"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>delete<wbr/>Webhook</span></a><a href="#getdevices"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Devices</span></a><a href="#getdevicestatus"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Device<wbr/>Status</span></a><a href="#setupwebhook"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>setup<wbr/>Webhook</span></a></div></details></div></details></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,47 +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>SwitchbotDevice | 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">SwitchbotDevice</a></li></ul><h1>Class SwitchbotDevice</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Represents a Switchbot Device.</p>
2
- </div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel tsd-hierarchy" data-refl="307"><h4>Hierarchy (<a href="../hierarchy.html#SwitchbotDevice">View Summary</a>)</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-signature-type">EventEmitter</span><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">SwitchbotDevice</span><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><a href="WoBlindTilt.html" class="tsd-signature-type tsd-kind-class">WoBlindTilt</a></li><li class="tsd-hierarchy-item"><a href="WoBulb.html" class="tsd-signature-type tsd-kind-class">WoBulb</a></li><li class="tsd-hierarchy-item"><a href="WoCeilingLight.html" class="tsd-signature-type tsd-kind-class">WoCeilingLight</a></li><li class="tsd-hierarchy-item"><a href="WoContact.html" class="tsd-signature-type tsd-kind-class">WoContact</a></li><li class="tsd-hierarchy-item"><a href="WoCurtain.html" class="tsd-signature-type tsd-kind-class">WoCurtain</a></li><li class="tsd-hierarchy-item"><a href="WoHand.html" class="tsd-signature-type tsd-kind-class">WoHand</a></li><li class="tsd-hierarchy-item"><a href="WoHub2.html" class="tsd-signature-type tsd-kind-class">WoHub2</a></li><li class="tsd-hierarchy-item"><a href="WoHub3.html" class="tsd-signature-type tsd-kind-class">WoHub3</a></li><li class="tsd-hierarchy-item"><a href="WoHumi.html" class="tsd-signature-type tsd-kind-class">WoHumi</a></li><li class="tsd-hierarchy-item"><a href="WoHumi2.html" class="tsd-signature-type tsd-kind-class">WoHumi2</a></li><li class="tsd-hierarchy-item"><a href="WoIOSensorTH.html" class="tsd-signature-type tsd-kind-class">WoIOSensorTH</a></li><li class="tsd-hierarchy-item"><a href="WoKeypad.html" class="tsd-signature-type tsd-kind-class">WoKeypad</a></li><li class="tsd-hierarchy-item"><a href="WoLeak.html" class="tsd-signature-type tsd-kind-class">WoLeak</a></li><li class="tsd-hierarchy-item"><a href="WoPlugMiniJP.html" class="tsd-signature-type tsd-kind-class">WoPlugMiniJP</a></li><li class="tsd-hierarchy-item"><a href="WoPlugMiniEU.html" class="tsd-signature-type tsd-kind-class">WoPlugMiniEU</a></li><li class="tsd-hierarchy-item"><a href="WoPlugMiniUS.html" class="tsd-signature-type tsd-kind-class">WoPlugMiniUS</a></li><li class="tsd-hierarchy-item"><a href="WoPresence.html" class="tsd-signature-type tsd-kind-class">WoPresence</a></li><li class="tsd-hierarchy-item"><a href="WoRelaySwitch1.html" class="tsd-signature-type tsd-kind-class">WoRelaySwitch1</a></li><li class="tsd-hierarchy-item"><a href="WoRelaySwitch1PM.html" class="tsd-signature-type tsd-kind-class">WoRelaySwitch1PM</a></li><li class="tsd-hierarchy-item"><a href="WoRemote.html" class="tsd-signature-type tsd-kind-class">WoRemote</a></li><li class="tsd-hierarchy-item"><a href="WoSensorTH.html" class="tsd-signature-type tsd-kind-class">WoSensorTH</a></li><li class="tsd-hierarchy-item"><a href="WoSensorTHPlus.html" class="tsd-signature-type tsd-kind-class">WoSensorTHPlus</a></li><li class="tsd-hierarchy-item"><a href="WoSensorTHPro.html" class="tsd-signature-type tsd-kind-class">WoSensorTHPro</a></li><li class="tsd-hierarchy-item"><a href="WoSensorTHProCO2.html" class="tsd-signature-type tsd-kind-class">WoSensorTHProCO2</a></li><li class="tsd-hierarchy-item"><a href="WoSmartLock.html" class="tsd-signature-type tsd-kind-class">WoSmartLock</a></li><li class="tsd-hierarchy-item"><a href="WoSmartLockPro.html" class="tsd-signature-type tsd-kind-class">WoSmartLockPro</a></li><li class="tsd-hierarchy-item"><a href="WoStrip.html" class="tsd-signature-type tsd-kind-class">WoStrip</a></li><li class="tsd-hierarchy-item"><a href="WoAirPurifier.html" class="tsd-signature-type tsd-kind-class">WoAirPurifier</a></li><li class="tsd-hierarchy-item"><a href="WoAirPurifierTable.html" class="tsd-signature-type tsd-kind-class">WoAirPurifierTable</a></li></ul></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L568">src/device.ts:568</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-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><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
3
- </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Accessors</h3><div class="tsd-index-list"><a href="#address" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>address</span></a>
4
- <a href="#connectionstate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>connection<wbr/>State</span></a>
5
- <a href="#friendlyname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>friendly<wbr/>Name</span></a>
6
- <a href="#id" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>id</span></a>
7
- <a href="#model" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>model</span></a>
8
- <a href="#modelname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>model<wbr/>Name</span></a>
9
- <a href="#onconnecthandler" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>on<wbr/>Connect<wbr/>Handler</span></a>
10
- <a href="#ondisconnecthandler" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>on<wbr/>Disconnect<wbr/>Handler</span></a>
11
- </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="#command" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>command</span></a>
12
- <a href="#connect" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connect</span></a>
13
- <a href="#disconnect" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>disconnect</span></a>
14
- <a href="#discoverservices" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>discover<wbr/>Services</span></a>
15
- <a href="#getcharacteristics" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Characteristics</span></a>
16
- <a href="#getdevicename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Device<wbr/>Name</span></a>
17
- <a href="#internalconnect" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>internal<wbr/>Connect</span></a>
18
- <a href="#log" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>log</span></a>
19
- <a href="#setdevicename" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Device<wbr/>Name</span></a>
20
- <a href="#unsubscribefromnotify" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>unsubscribe<wbr/>From<wbr/>Notify</span></a>
21
- </div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructorswitchbotdevice"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">SwitchbotDevice</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">peripheral</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Peripheral</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">noble</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Noble</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">SwitchbotDevice</a><a href="#constructorswitchbotdevice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initializes a new instance of the SwitchbotDevice class.</p>
22
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">peripheral</span>: <span class="tsd-signature-type">Peripheral</span></span><div class="tsd-comment tsd-typography"><p>The peripheral object from noble.</p>
23
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">noble</span>: <span class="tsd-signature-type">Noble</span></span><div class="tsd-comment tsd-typography"><p>The Noble object.</p>
24
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">SwitchbotDevice</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Overrides EventEmitter.constructor</p><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L588">src/device.ts:588</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Accessors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Accessors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="address"><span>address</span><a href="#address" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="addressaddress"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">address</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L616">src/device.ts:616</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="connectionstate"><span>connection<wbr/>State</span><a href="#connectionstate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="connectionstateconnectionstate"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">connectionState</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L632">src/device.ts:632</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="friendlyname"><span>friendly<wbr/>Name</span><a href="#friendlyname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="friendlynamefriendlyname"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">friendlyName</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="../enums/SwitchBotBLEModelFriendlyName.html" class="tsd-signature-type tsd-kind-enum">SwitchBotBLEModelFriendlyName</a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="../enums/SwitchBotBLEModelFriendlyName.html" class="tsd-signature-type tsd-kind-enum">SwitchBotBLEModelFriendlyName</a></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L628">src/device.ts:628</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="id"><span>id</span><a href="#id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="idid"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">id</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L612">src/device.ts:612</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="model"><span>model</span><a href="#model" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="modelmodel"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">model</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="../enums/SwitchBotBLEModel.html" class="tsd-signature-type tsd-kind-enum">SwitchBotBLEModel</a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="../enums/SwitchBotBLEModel.html" class="tsd-signature-type tsd-kind-enum">SwitchBotBLEModel</a></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L620">src/device.ts:620</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="modelname"><span>model<wbr/>Name</span><a href="#modelname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="modelnamemodelname"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">modelName</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="../enums/SwitchBotBLEModelName.html" class="tsd-signature-type tsd-kind-enum">SwitchBotBLEModelName</a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="../enums/SwitchBotBLEModelName.html" class="tsd-signature-type tsd-kind-enum">SwitchBotBLEModelName</a></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L624">src/device.ts:624</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="onconnecthandler"><span>on<wbr/>Connect<wbr/>Handler</span><a href="#onconnecthandler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="onconnecthandleronconnecthandler"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">onConnectHandler</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L636">src/device.ts:636</a></li></ul></aside></div></li><li><div class="tsd-signature" id="onconnecthandleronconnecthandler-1"><span class="tsd-signature-keyword">set</span> <span class="tsd-kind-set-signature">onConnectHandler</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">func</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">func</span>: <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L640">src/device.ts:640</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="ondisconnecthandler"><span>on<wbr/>Disconnect<wbr/>Handler</span><a href="#ondisconnecthandler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="ondisconnecthandlerondisconnecthandler"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">onDisconnectHandler</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L649">src/device.ts:649</a></li></ul></aside></div></li><li><div class="tsd-signature" id="ondisconnecthandlerondisconnecthandler-1"><span class="tsd-signature-keyword">set</span> <span class="tsd-kind-set-signature">onDisconnectHandler</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">func</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">func</span>: <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L653">src/device.ts:653</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Methods</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="command"><span>command</span><a href="#command" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="command-1"><span class="tsd-kind-call-signature">command</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">reqBuf</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">ArrayBufferLike</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span><a href="#command-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sends a command to the device and awaits a response.</p>
25
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">reqBuf</span>: <span class="tsd-signature-type">Buffer</span></span><div class="tsd-comment tsd-typography"><p>The command buffer.</p>
26
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">ArrayBufferLike</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A Promise that resolves with the response buffer.</p>
27
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L884">src/device.ts:884</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="connect"><span>connect</span><a href="#connect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="connect-1"><span class="tsd-kind-call-signature">connect</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#connect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Connects to the device.</p>
28
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A Promise that resolves when the connection is complete.</p>
29
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L666">src/device.ts:666</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="disconnect"><span>disconnect</span><a href="#disconnect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="disconnect-1"><span class="tsd-kind-call-signature">disconnect</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#disconnect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Disconnects from the device.</p>
30
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A Promise that resolves when the disconnection is complete.</p>
31
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L805">src/device.ts:805</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="discoverservices"><span>discover<wbr/>Services</span><a href="#discoverservices" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="discoverservices-1"><span class="tsd-kind-call-signature">discoverServices</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Service</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span><a href="#discoverservices-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Discovers the device services.</p>
32
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Service</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A Promise that resolves with the list of services.</p>
33
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L751">src/device.ts:751</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getcharacteristics"><span>get<wbr/>Characteristics</span><a href="#getcharacteristics" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getcharacteristics-1"><span class="tsd-kind-call-signature">getCharacteristics</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/Chars.html" class="tsd-signature-type tsd-kind-interface">Chars</a><span class="tsd-signature-symbol">&gt;</span><a href="#getcharacteristics-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the device characteristics.</p>
34
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/Chars.html" class="tsd-signature-type tsd-kind-interface">Chars</a><span class="tsd-signature-symbol">&gt;</span></h4><p>A Promise that resolves with the device characteristics.</p>
35
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L709">src/device.ts:709</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getdevicename"><span>get<wbr/>Device<wbr/>Name</span><a href="#getdevicename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getdevicename-1"><span class="tsd-kind-call-signature">getDeviceName</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span><a href="#getdevicename-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the device name.</p>
36
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A Promise that resolves with the device name.</p>
37
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L835">src/device.ts:835</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="internalconnect"><span>internal<wbr/>Connect</span><a href="#internalconnect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="internalconnect-1"><span class="tsd-kind-call-signature">internalConnect</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#internalconnect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Internal method to handle the connection process.</p>
38
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A Promise that resolves when the connection is complete.</p>
39
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L675">src/device.ts:675</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="log"><span>log</span><a href="#log" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="log-1"><span class="tsd-kind-call-signature">log</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">level</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">message</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> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#log-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Logs a message with the specified log level.</p>
40
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">level</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The severity level of the log (e.g., 'info', 'warn', 'error').</p>
41
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">message</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The log message to be emitted.</p>
42
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L607">src/device.ts:607</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="setdevicename"><span>set<wbr/>Device<wbr/>Name</span><a href="#setdevicename" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="setdevicename-1"><span class="tsd-kind-call-signature">setDeviceName</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</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> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#setdevicename-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sets the device name.</p>
43
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The new device name.</p>
44
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A Promise that resolves when the name is set.</p>
45
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L856">src/device.ts:856</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="unsubscribefromnotify"><span>unsubscribe<wbr/>From<wbr/>Notify</span><a href="#unsubscribefromnotify" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="unsubscribefromnotify-1"><span class="tsd-kind-call-signature">unsubscribeFromNotify</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#unsubscribefromnotify-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Unsubscribes from the notify characteristic.</p>
46
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><p>A Promise that resolves when the unsubscription is complete.</p>
47
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/1eb8d2e572e211482105c2563a736bdfabeb50be/src/device.ts#L792">src/device.ts:792</a></li></ul></aside></div></li></ul></section></section></details></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><details open class="tsd-accordion tsd-page-navigation"><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>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Accessors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Accessors</summary><div><a href="#address"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>address</span></a><a href="#connectionstate"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>connection<wbr/>State</span></a><a href="#friendlyname"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>friendly<wbr/>Name</span></a><a href="#id"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>id</span></a><a href="#model"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>model</span></a><a href="#modelname"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>model<wbr/>Name</span></a><a href="#onconnecthandler"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>on<wbr/>Connect<wbr/>Handler</span></a><a href="#ondisconnecthandler"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>on<wbr/>Disconnect<wbr/>Handler</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#command"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>command</span></a><a href="#connect"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connect</span></a><a href="#disconnect"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>disconnect</span></a><a href="#discoverservices"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>discover<wbr/>Services</span></a><a href="#getcharacteristics"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Characteristics</span></a><a href="#getdevicename"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Device<wbr/>Name</span></a><a href="#internalconnect"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>internal<wbr/>Connect</span></a><a href="#log"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>log</span></a><a href="#setdevicename"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Device<wbr/>Name</span></a><a href="#unsubscribefromnotify"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>unsubscribe<wbr/>From<wbr/>Notify</span></a></div></details></div></details></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>