@switchbot/homebridge-switchbot 3.8.3-beta.3 → 3.8.3-beta.31

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 (203) hide show
  1. package/.github/workflows/beta-release.yml +7 -4
  2. package/.github/workflows/release.yml +7 -6
  3. package/CHANGELOG.md +2 -1
  4. package/config.schema.json +24 -0
  5. package/dist/device/blindtilt.d.ts +1 -4
  6. package/dist/device/blindtilt.d.ts.map +1 -1
  7. package/dist/device/blindtilt.js +33 -34
  8. package/dist/device/blindtilt.js.map +1 -1
  9. package/dist/device/bot.d.ts +1 -4
  10. package/dist/device/bot.d.ts.map +1 -1
  11. package/dist/device/bot.js +30 -31
  12. package/dist/device/bot.js.map +1 -1
  13. package/dist/device/ceilinglight.d.ts +1 -4
  14. package/dist/device/ceilinglight.d.ts.map +1 -1
  15. package/dist/device/ceilinglight.js +50 -54
  16. package/dist/device/ceilinglight.js.map +1 -1
  17. package/dist/device/colorbulb.d.ts +1 -4
  18. package/dist/device/colorbulb.d.ts.map +1 -1
  19. package/dist/device/colorbulb.js +62 -66
  20. package/dist/device/colorbulb.js.map +1 -1
  21. package/dist/device/contact.d.ts +1 -4
  22. package/dist/device/contact.d.ts.map +1 -1
  23. package/dist/device/contact.js +18 -18
  24. package/dist/device/contact.js.map +1 -1
  25. package/dist/device/curtain.d.ts +1 -4
  26. package/dist/device/curtain.d.ts.map +1 -1
  27. package/dist/device/curtain.js +31 -32
  28. package/dist/device/curtain.js.map +1 -1
  29. package/dist/device/device.d.ts +6 -6
  30. package/dist/device/device.d.ts.map +1 -1
  31. package/dist/device/device.js +33 -17
  32. package/dist/device/device.js.map +1 -1
  33. package/dist/device/fan.d.ts +1 -4
  34. package/dist/device/fan.d.ts.map +1 -1
  35. package/dist/device/fan.js +47 -49
  36. package/dist/device/fan.js.map +1 -1
  37. package/dist/device/hub.d.ts +1 -4
  38. package/dist/device/hub.d.ts.map +1 -1
  39. package/dist/device/hub.js +18 -18
  40. package/dist/device/hub.js.map +1 -1
  41. package/dist/device/humidifier.d.ts +1 -4
  42. package/dist/device/humidifier.d.ts.map +1 -1
  43. package/dist/device/humidifier.js +43 -46
  44. package/dist/device/humidifier.js.map +1 -1
  45. package/dist/device/iosensor.d.ts +1 -4
  46. package/dist/device/iosensor.d.ts.map +1 -1
  47. package/dist/device/iosensor.js +18 -18
  48. package/dist/device/iosensor.js.map +1 -1
  49. package/dist/device/lightstrip.d.ts +1 -4
  50. package/dist/device/lightstrip.d.ts.map +1 -1
  51. package/dist/device/lightstrip.js +51 -54
  52. package/dist/device/lightstrip.js.map +1 -1
  53. package/dist/device/lock.d.ts +1 -4
  54. package/dist/device/lock.d.ts.map +1 -1
  55. package/dist/device/lock.js +31 -32
  56. package/dist/device/lock.js.map +1 -1
  57. package/dist/device/meter.d.ts +1 -4
  58. package/dist/device/meter.d.ts.map +1 -1
  59. package/dist/device/meter.js +18 -18
  60. package/dist/device/meter.js.map +1 -1
  61. package/dist/device/meterplus.d.ts +1 -4
  62. package/dist/device/meterplus.d.ts.map +1 -1
  63. package/dist/device/meterplus.js +18 -18
  64. package/dist/device/meterplus.js.map +1 -1
  65. package/dist/device/motion.d.ts +1 -4
  66. package/dist/device/motion.d.ts.map +1 -1
  67. package/dist/device/motion.js +18 -18
  68. package/dist/device/motion.js.map +1 -1
  69. package/dist/device/plug.d.ts +1 -4
  70. package/dist/device/plug.d.ts.map +1 -1
  71. package/dist/device/plug.js +29 -30
  72. package/dist/device/plug.js.map +1 -1
  73. package/dist/device/robotvacuumcleaner.d.ts +1 -4
  74. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  75. package/dist/device/robotvacuumcleaner.js +36 -38
  76. package/dist/device/robotvacuumcleaner.js.map +1 -1
  77. package/dist/device/waterdetector.d.ts +1 -4
  78. package/dist/device/waterdetector.d.ts.map +1 -1
  79. package/dist/device/waterdetector.js +18 -18
  80. package/dist/device/waterdetector.js.map +1 -1
  81. package/dist/irdevice/airconditioner.d.ts +1 -1
  82. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  83. package/dist/irdevice/airconditioner.js +11 -12
  84. package/dist/irdevice/airconditioner.js.map +1 -1
  85. package/dist/irdevice/airpurifier.d.ts +1 -1
  86. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  87. package/dist/irdevice/airpurifier.js +11 -12
  88. package/dist/irdevice/airpurifier.js.map +1 -1
  89. package/dist/irdevice/camera.d.ts +1 -1
  90. package/dist/irdevice/camera.d.ts.map +1 -1
  91. package/dist/irdevice/camera.js +9 -10
  92. package/dist/irdevice/camera.js.map +1 -1
  93. package/dist/irdevice/fan.d.ts +1 -1
  94. package/dist/irdevice/fan.d.ts.map +1 -1
  95. package/dist/irdevice/fan.js +15 -16
  96. package/dist/irdevice/fan.js.map +1 -1
  97. package/dist/irdevice/irdevice.d.ts +6 -6
  98. package/dist/irdevice/irdevice.d.ts.map +1 -1
  99. package/dist/irdevice/irdevice.js +7 -13
  100. package/dist/irdevice/irdevice.js.map +1 -1
  101. package/dist/irdevice/light.d.ts +1 -1
  102. package/dist/irdevice/light.d.ts.map +1 -1
  103. package/dist/irdevice/light.js +9 -10
  104. package/dist/irdevice/light.js.map +1 -1
  105. package/dist/irdevice/other.d.ts +1 -1
  106. package/dist/irdevice/other.d.ts.map +1 -1
  107. package/dist/irdevice/other.js +9 -10
  108. package/dist/irdevice/other.js.map +1 -1
  109. package/dist/irdevice/tv.d.ts +1 -1
  110. package/dist/irdevice/tv.d.ts.map +1 -1
  111. package/dist/irdevice/tv.js +27 -28
  112. package/dist/irdevice/tv.js.map +1 -1
  113. package/dist/irdevice/vacuumcleaner.d.ts +1 -1
  114. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  115. package/dist/irdevice/vacuumcleaner.js +9 -10
  116. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  117. package/dist/irdevice/waterheater.d.ts +1 -1
  118. package/dist/irdevice/waterheater.d.ts.map +1 -1
  119. package/dist/irdevice/waterheater.js +9 -10
  120. package/dist/irdevice/waterheater.js.map +1 -1
  121. package/dist/platform.d.ts +6 -14
  122. package/dist/platform.d.ts.map +1 -1
  123. package/dist/platform.js +127 -188
  124. package/dist/platform.js.map +1 -1
  125. package/dist/settings.d.ts +4 -3
  126. package/dist/settings.d.ts.map +1 -1
  127. package/dist/settings.js.map +1 -1
  128. package/dist/utils.d.ts +1 -1
  129. package/dist/utils.d.ts.map +1 -1
  130. package/dist/utils.js.map +1 -1
  131. package/docs/assets/highlight.css +42 -0
  132. package/docs/assets/main.js +1 -1
  133. package/docs/functions/default.html +1 -1
  134. package/docs/index.html +61 -50
  135. package/docs/media/security-privacy-bluetooth.png +0 -0
  136. package/package.json +14 -15
  137. package/src/device/blindtilt.ts +35 -39
  138. package/src/device/bot.ts +31 -35
  139. package/src/device/ceilinglight.ts +51 -58
  140. package/src/device/colorbulb.ts +63 -70
  141. package/src/device/contact.ts +19 -22
  142. package/src/device/curtain.ts +33 -37
  143. package/src/device/device.ts +32 -21
  144. package/src/device/fan.ts +48 -53
  145. package/src/device/hub.ts +19 -22
  146. package/src/device/humidifier.ts +44 -50
  147. package/src/device/iosensor.ts +19 -22
  148. package/src/device/lightstrip.ts +52 -58
  149. package/src/device/lock.ts +32 -36
  150. package/src/device/meter.ts +19 -22
  151. package/src/device/meterplus.ts +19 -22
  152. package/src/device/motion.ts +19 -22
  153. package/src/device/plug.ts +30 -34
  154. package/src/device/robotvacuumcleaner.ts +37 -46
  155. package/src/device/waterdetector.ts +19 -22
  156. package/src/irdevice/airconditioner.ts +12 -14
  157. package/src/irdevice/airpurifier.ts +12 -13
  158. package/src/irdevice/camera.ts +10 -11
  159. package/src/irdevice/fan.ts +16 -17
  160. package/src/irdevice/irdevice.ts +9 -17
  161. package/src/irdevice/light.ts +10 -11
  162. package/src/irdevice/other.ts +10 -11
  163. package/src/irdevice/tv.ts +28 -29
  164. package/src/irdevice/vacuumcleaner.ts +10 -11
  165. package/src/irdevice/waterheater.ts +10 -11
  166. package/src/platform.ts +131 -188
  167. package/src/settings.ts +8 -4
  168. package/src/utils.ts +2 -1
  169. package/dist/types/bledevicestatus.d.ts +0 -281
  170. package/dist/types/bledevicestatus.d.ts.map +0 -1
  171. package/dist/types/bledevicestatus.js +0 -2
  172. package/dist/types/bledevicestatus.js.map +0 -1
  173. package/dist/types/devicelist.d.ts +0 -89
  174. package/dist/types/devicelist.d.ts.map +0 -1
  175. package/dist/types/devicelist.js +0 -6
  176. package/dist/types/devicelist.js.map +0 -1
  177. package/dist/types/deviceresponse.d.ts +0 -13
  178. package/dist/types/deviceresponse.d.ts.map +0 -1
  179. package/dist/types/deviceresponse.js +0 -2
  180. package/dist/types/deviceresponse.js.map +0 -1
  181. package/dist/types/devicestatus.d.ts +0 -149
  182. package/dist/types/devicestatus.d.ts.map +0 -1
  183. package/dist/types/devicestatus.js +0 -3
  184. package/dist/types/devicestatus.js.map +0 -1
  185. package/dist/types/devicewebhookstatus.d.ts +0 -156
  186. package/dist/types/devicewebhookstatus.d.ts.map +0 -1
  187. package/dist/types/devicewebhookstatus.js +0 -2
  188. package/dist/types/devicewebhookstatus.js.map +0 -1
  189. package/dist/types/irdevicelist.d.ts +0 -10
  190. package/dist/types/irdevicelist.d.ts.map +0 -1
  191. package/dist/types/irdevicelist.js +0 -2
  192. package/dist/types/irdevicelist.js.map +0 -1
  193. package/dist/types/pushbody.d.ts +0 -6
  194. package/dist/types/pushbody.d.ts.map +0 -1
  195. package/dist/types/pushbody.js +0 -2
  196. package/dist/types/pushbody.js.map +0 -1
  197. package/src/types/bledevicestatus.ts +0 -303
  198. package/src/types/devicelist.ts +0 -124
  199. package/src/types/deviceresponse.ts +0 -14
  200. package/src/types/devicestatus.ts +0 -178
  201. package/src/types/devicewebhookstatus.ts +0 -191
  202. package/src/types/irdevicelist.ts +0 -15
  203. package/src/types/pushbody.ts +0 -9
package/docs/index.html CHANGED
@@ -1,17 +1,17 @@
1
1
  <!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@switchbot/homebridge-switchbot</title><meta name="description" content="Documentation for @switchbot/homebridge-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></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@switchbot/homebridge-switchbot</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>@switchbot/homebridge-switchbot</h2></div><div class="tsd-panel tsd-typography"><span align="center">
2
2
  <p><a href="https://github.com/homebridge/verified/blob/master/verified-plugins.json"><img alt="homebridge-verified" src="https://raw.githubusercontent.com/OpenWonderLabs/homebridge-switchbot/latest/branding/Homebridge_x_SwitchBot.svg?sanitize=true" width="350px"></a></p>
3
- <a id="md:switchbothomebridge-switchbot" class="tsd-anchor"></a><h1 class="tsd-anchor-link">@switchbot/homebridge-switchbot<a href="#md:switchbothomebridge-switchbot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p><a href="https://www.npmjs.com/package/@switchbot/homebridge-switchbot"><img src="https://badgen.net/npm/v/@switchbot/homebridge-switchbot" alt="npm version"></a>
4
- <a href="https://www.npmjs.com/package/@switchbot/homebridge-switchbot"><img src="https://badgen.net/npm/dt/@switchbot/homebridge-switchbot" alt="npm downloads"></a>
5
- <a href="https://discord.gg/5wYTbwP4ha"><img src="https://badgen.net/discord/online-members/5wYTbwP4ha?icon=discord&amp;label=discord" alt="discord-switchbot"></a></p>
3
+ <a id="md:switchbothomebridge-switchbot" class="tsd-anchor"></a><h1 class="tsd-anchor-link">@switchbot/homebridge-switchbot<a href="#md:switchbothomebridge-switchbot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p><a href="https://www.npmjs.com/package/@switchbot/homebridge-switchbot" target="_blank" class="external"><img src="https://badgen.net/npm/v/@switchbot/homebridge-switchbot" alt="npm version"></a>
4
+ <a href="https://www.npmjs.com/package/@switchbot/homebridge-switchbot" target="_blank" class="external"><img src="https://badgen.net/npm/dt/@switchbot/homebridge-switchbot" alt="npm downloads"></a>
5
+ <a href="https://discord.gg/5wYTbwP4ha" target="_blank" class="external"><img src="https://badgen.net/discord/online-members/5wYTbwP4ha?icon=discord&amp;label=discord" alt="discord-switchbot"></a></p>
6
6
  <p>The Homebridge <a href="https://www.switch-bot.com">SwitchBot</a> plugin allows you to access your SwitchBot Device(s) from HomeKit with
7
- <a href="https://homebridge.io">Homebridge</a>.
7
+ <a href="https://homebridge.io">Homebridge</a>.
8
8
  </p>
9
9
  </span>
10
10
  <a id="md:installation" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Installation<a href="#md:installation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ol>
11
- <li>Search for &quot;SwitchBot&quot; on the plugin screen of <a href="https://github.com/oznu/homebridge-config-ui-x">Homebridge Config UI X</a></li>
11
+ <li>Search for &quot;SwitchBot&quot; on the plugin screen of <a href="https://github.com/oznu/homebridge-config-ui-x" target="_blank" class="external">Homebridge Config UI X</a></li>
12
12
  <li>Find: <code>@switchbot/homebridge-switchbot</code>
13
13
  <ul>
14
- <li>See noble <a href="https://github.com/abandonware/noble#prerequisites">prerequisites</a> for your OS. (This is used for BLE connection.)</li>
14
+ <li>See noble <a href="https://github.com/abandonware/noble#prerequisites" target="_blank" class="external">prerequisites</a> for your OS. (This is used for BLE connection.)</li>
15
15
  </ul>
16
16
  </li>
17
17
  <li>Click <strong>Install</strong></li>
@@ -80,10 +80,21 @@
80
80
  <p>This lists all discovered Bluetooth devices. The BLE address of the SwitchBot device should be included in this list, otherwise your computer does not discover it.</p>
81
81
  </li>
82
82
  </ol>
83
+ </li>
84
+ <li>
85
+ <a id="md:if-using-macos" class="tsd-anchor"></a><h3 class="tsd-anchor-link">If using MacOS<a href="#md:if-using-macos" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ol>
86
+ <li>Manually grant Bluetooth access in System Settings UI for <code>Security &amp; Privacy -&gt; Privacy</code> to the node executable, eg <code>/usr/local/bin/node</code>
87
+ <img src="media/security-privacy-bluetooth.png" alt="Security &amp; Privacy -&gt; Privacy">
88
+ (This is what is intended in documentation for the noble bluetooth package <a href="https://github.com/abandonware/noble#prerequisites" target="_blank" class="external">prerequisites</a> by &quot;Add terminal app&quot;, however for HomeBridge it is <code>node</code> that needs the permission granted, not <code>terminal</code>.
89
+ Without this step, then you will receive the following error when the swichbot plugin launches, which will cause Homebridge or the child bridge process to restart:</li>
90
+ </ol>
91
+ <pre><code><span class="hl-0">Error</span><span class="hl-1">: </span><span class="hl-2">Failed</span><span class="hl-1"> </span><span class="hl-2">to</span><span class="hl-1"> </span><span class="hl-2">initialize</span><span class="hl-1"> </span><span class="hl-2">the</span><span class="hl-1"> </span><span class="hl-2">Noble</span><span class="hl-1"> </span><span class="hl-0">object</span><span class="hl-1">: </span><span class="hl-2">unauthorized</span><br/><span class="hl-1"> </span><span class="hl-2">at</span><span class="hl-1"> </span><span class="hl-2">Noble</span><span class="hl-1">.&lt;</span><span class="hl-3">anonymous</span><span class="hl-1">&gt; (</span><span class="hl-2">file</span><span class="hl-1">:</span><span class="hl-4">///usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/node-switchbot/src/switchbot.ts:244:19)</span><br/><span class="hl-1"> </span><span class="hl-3">at</span><span class="hl-1"> </span><span class="hl-3">Object</span><span class="hl-1">.</span><span class="hl-3">onceWrapper</span><span class="hl-1"> (</span><span class="hl-2">node</span><span class="hl-1">:</span><span class="hl-3">events</span><span class="hl-1">:</span><span class="hl-5">629</span><span class="hl-1">:</span><span class="hl-5">26</span><span class="hl-1">)</span><br/><span class="hl-1"> </span><span class="hl-3">at</span><span class="hl-1"> </span><span class="hl-3">Noble</span><span class="hl-1">.</span><span class="hl-3">emit</span><span class="hl-1"> (</span><span class="hl-2">node</span><span class="hl-1">:</span><span class="hl-3">events</span><span class="hl-1">:</span><span class="hl-5">514</span><span class="hl-1">:</span><span class="hl-5">28</span><span class="hl-1">)</span><br/><span class="hl-1"> </span><span class="hl-3">at</span><span class="hl-1"> </span><span class="hl-3">Noble</span><span class="hl-1">.</span><span class="hl-3">onStateChange</span><span class="hl-1"> (/</span><span class="hl-3">usr</span><span class="hl-1">/</span><span class="hl-3">local</span><span class="hl-1">/</span><span class="hl-3">lib</span><span class="hl-1">/</span><span class="hl-3">node_modules</span><span class="hl-1">/@</span><span class="hl-3">switchbot</span><span class="hl-1">/</span><span class="hl-3">homebridge</span><span class="hl-1">-</span><span class="hl-3">switchbot</span><span class="hl-1">/</span><span class="hl-3">node_modules</span><span class="hl-1">/@</span><span class="hl-3">stoprocent</span><span class="hl-1">/</span><span class="hl-3">noble</span><span class="hl-1">/</span><span class="hl-3">lib</span><span class="hl-1">/</span><span class="hl-3">noble</span><span class="hl-1">.</span><span class="hl-3">js</span><span class="hl-1">:</span><span class="hl-5">92</span><span class="hl-1">:</span><span class="hl-5">8</span><span class="hl-1">)</span><br/><span class="hl-1"> </span><span class="hl-3">at</span><span class="hl-1"> </span><span class="hl-3">NobleMac</span><span class="hl-1">.</span><span class="hl-3">emit</span><span class="hl-1"> (</span><span class="hl-2">node</span><span class="hl-1">:</span><span class="hl-3">events</span><span class="hl-1">:</span><span class="hl-5">514</span><span class="hl-1">:</span><span class="hl-5">28</span><span class="hl-1">)</span>
92
+ </code><button>Copy</button></pre>
93
+
83
94
  </li>
84
95
  </ul>
85
96
  <a id="md:supported-switchbot-devices" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Supported SwitchBot Devices<a href="#md:supported-switchbot-devices" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
86
- <li><a href="https://www.switch-bot.com/products/switchbot-smart-humidifier">SwitchBot Humidifier</a>
97
+ <li><a href="https://www.switch-bot.com/products/switchbot-smart-humidifier" target="_blank" class="external">SwitchBot Humidifier</a>
87
98
  <ul>
88
99
  <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections
89
100
  <ul>
@@ -93,15 +104,15 @@
93
104
  </li>
94
105
  </ul>
95
106
  </li>
96
- <li><a href="https://www.switch-bot.com/products/switchbot-meter">SwitchBot Meter</a></li>
97
- <li><a href="https://www.switch-bot.com/products/switchbot-meter-plus">SwitchBot Meter Plus (US)</a></li>
98
- <li><a href="https://www.switchbot.jp/products/switchbot-meter-plus">SwitchBot Meter Plus (JP)</a></li>
99
- <li><a href="https://www.switch-bot.com/products/switchbot-indoor-outdoor-thermo-hygrometer">SwitchBot Indoor/Outdoor Thermo-Hygrometer</a>
107
+ <li><a href="https://www.switch-bot.com/products/switchbot-meter" target="_blank" class="external">SwitchBot Meter</a></li>
108
+ <li><a href="https://www.switch-bot.com/products/switchbot-meter-plus" target="_blank" class="external">SwitchBot Meter Plus (US)</a></li>
109
+ <li><a href="https://www.switchbot.jp/products/switchbot-meter-plus" target="_blank" class="external">SwitchBot Meter Plus (JP)</a></li>
110
+ <li><a href="https://www.switch-bot.com/products/switchbot-indoor-outdoor-thermo-hygrometer" target="_blank" class="external">SwitchBot Indoor/Outdoor Thermo-Hygrometer</a>
100
111
  <ul>
101
112
  <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
102
113
  <li>If using OpenAPI:
103
114
  <ul>
104
- <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a> Required</li>
115
+ <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini" target="_blank" class="external">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a> Required</li>
105
116
  <li>Enable Cloud Services for Device on SwitchBot App</li>
106
117
  </ul>
107
118
  </li>
@@ -113,12 +124,12 @@
113
124
  </li>
114
125
  </ul>
115
126
  </li>
116
- <li><a href="https://www.switch-bot.com/products/motion-sensor">SwitchBot Motion Sensor</a>
127
+ <li><a href="https://www.switch-bot.com/products/motion-sensor" target="_blank" class="external">SwitchBot Motion Sensor</a>
117
128
  <ul>
118
129
  <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
119
130
  <li>If using OpenAPI:
120
131
  <ul>
121
- <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a> Required</li>
132
+ <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini" target="_blank" class="external">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a> Required</li>
122
133
  <li>Enable Cloud Services for Device on SwitchBot App</li>
123
134
  </ul>
124
135
  </li>
@@ -130,12 +141,12 @@
130
141
  </li>
131
142
  </ul>
132
143
  </li>
133
- <li><a href="https://www.switch-bot.com/products/contact-sensor">SwitchBot Contact Sensor</a>
144
+ <li><a href="https://www.switch-bot.com/products/contact-sensor" target="_blank" class="external">SwitchBot Contact Sensor</a>
134
145
  <ul>
135
146
  <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
136
147
  <li>If using OpenAPI:
137
148
  <ul>
138
- <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a> Required</li>
149
+ <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini" target="_blank" class="external">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a> Required</li>
139
150
  <li>Enable Cloud Services for Device on SwitchBot App</li>
140
151
  </ul>
141
152
  </li>
@@ -147,13 +158,13 @@
147
158
  </li>
148
159
  </ul>
149
160
  </li>
150
- <li><a href="https://www.switch-bot.com/products/switchbot-curtain">SwitchBot Curtain</a></li>
151
- <li><a href="https://www.switch-bot.com/products/switchbot-curtain-3">SwitchBot Curtain 3</a>
161
+ <li><a href="https://www.switch-bot.com/products/switchbot-curtain" target="_blank" class="external">SwitchBot Curtain</a></li>
162
+ <li><a href="https://www.switch-bot.com/products/switchbot-curtain-3" target="_blank" class="external">SwitchBot Curtain 3</a>
152
163
  <ul>
153
164
  <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
154
165
  <li>If using OpenAPI:
155
166
  <ul>
156
- <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a> Required</li>
167
+ <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini" target="_blank" class="external">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a> Required</li>
157
168
  <li>Enable Cloud Services for Device on SwitchBot App</li>
158
169
  </ul>
159
170
  </li>
@@ -165,70 +176,70 @@
165
176
  </li>
166
177
  </ul>
167
178
  </li>
168
- <li><a href="https://us.switch-bot.com/products/switchbot-blind-tilt">SwitchBot Blind Tilt</a>
179
+ <li><a href="https://us.switch-bot.com/products/switchbot-blind-tilt" target="_blank" class="external">SwitchBot Blind Tilt</a>
169
180
  <ul>
170
181
  <li>Supports OpenAPI &amp; partial Bluetooth Low Energy (BLE) Connections</li>
171
182
  <li>If using OpenAPI:
172
183
  <ul>
173
- <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a> Required</li>
184
+ <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini" target="_blank" class="external">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a> Required</li>
174
185
  <li>Enable Cloud Services for Device on SwitchBot App</li>
175
186
  </ul>
176
187
  </li>
177
188
  </ul>
178
189
  </li>
179
- <li><a href="https://www.switch-bot.com/products/switchbot-color-bulb">SwitchBot Bulb</a></li>
180
- <li><a href="https://www.switchbot.jp/collections/all/products/switchbot-ceiling-light">SwitchBot Ceiling Light</a></li>
181
- <li><a href="https://www.switchbot.jp/collections/all/products/switchbot-ceiling-light">SwitchBot Ceiling Light Pro</a></li>
182
- <li><a href="https://www.switch-bot.com/products/switchbot-light-strip">SwitchBot Light Strip</a>
190
+ <li><a href="https://www.switch-bot.com/products/switchbot-color-bulb" target="_blank" class="external">SwitchBot Bulb</a></li>
191
+ <li><a href="https://www.switchbot.jp/collections/all/products/switchbot-ceiling-light" target="_blank" class="external">SwitchBot Ceiling Light</a></li>
192
+ <li><a href="https://www.switchbot.jp/collections/all/products/switchbot-ceiling-light" target="_blank" class="external">SwitchBot Ceiling Light Pro</a></li>
193
+ <li><a href="https://www.switch-bot.com/products/switchbot-light-strip" target="_blank" class="external">SwitchBot Light Strip</a>
183
194
  <ul>
184
195
  <li>Supports OpenAPI &amp; partial Bluetooth Low Energy (BLE) Connections</li>
185
196
  <li>If using OpenAPI:
186
197
  <ul>
187
- <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a> Required</li>
198
+ <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini" target="_blank" class="external">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a> Required</li>
188
199
  <li>Enable Cloud Services for Device on SwitchBot App</li>
189
200
  </ul>
190
201
  </li>
191
202
  </ul>
192
203
  </li>
193
- <li><a href="https://us.switch-bot.com/products/switchbot-lock">SwitchBot Lock</a></li>
194
- <li><a href="https://www.switchbot.jp/products/switchbot-lock-pro">SwitchBot Lock Pro</a>
204
+ <li><a href="https://us.switch-bot.com/products/switchbot-lock" target="_blank" class="external">SwitchBot Lock</a></li>
205
+ <li><a href="https://www.switchbot.jp/products/switchbot-lock-pro" target="_blank" class="external">SwitchBot Lock Pro</a>
195
206
  <ul>
196
207
  <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
197
208
  <li>If using OpenAPI:
198
209
  <ul>
199
- <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a> Required</li>
210
+ <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini" target="_blank" class="external">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a> Required</li>
200
211
  <li>Enable Cloud Services for Device on SwitchBot App</li>
201
212
  </ul>
202
213
  </li>
203
214
  </ul>
204
215
  </li>
205
- <li>US: <a href="https://www.switch-bot.com/products/switchbot-mini-robot-vacuum-k10">SwitchBot Mini Robot Vacuum K10+</a></li>
206
- <li>US: <a href="https://www.switch-bot.com/products/switchbot-floor-cleaning-robot-s10">SwitchBot Floor Cleaning Robot S10</a></li>
207
- <li>JP: <a href="https://www.switchbot.jp/products/switchbot-robot-vacuum-cleaner">SwitchBot Robot Vacuum Cleaner S1</a></li>
208
- <li>JP: <a href="https://www.switchbot.jp/products/switchbot-robot-vacuum-cleaner">SwitchBot Robot Vacuum Cleaner S1 Plus</a>
216
+ <li>US: <a href="https://www.switch-bot.com/products/switchbot-mini-robot-vacuum-k10" target="_blank" class="external">SwitchBot Mini Robot Vacuum K10+</a></li>
217
+ <li>US: <a href="https://www.switch-bot.com/products/switchbot-floor-cleaning-robot-s10" target="_blank" class="external">SwitchBot Floor Cleaning Robot S10</a></li>
218
+ <li>JP: <a href="https://www.switchbot.jp/products/switchbot-robot-vacuum-cleaner" target="_blank" class="external">SwitchBot Robot Vacuum Cleaner S1</a></li>
219
+ <li>JP: <a href="https://www.switchbot.jp/products/switchbot-robot-vacuum-cleaner" target="_blank" class="external">SwitchBot Robot Vacuum Cleaner S1 Plus</a>
209
220
  <ul>
210
221
  <li>Supports OpenAPI Connection Only</li>
211
222
  </ul>
212
223
  </li>
213
- <li><a href="https://www.switch-bot.com/products/switchbot-plug">SwitchBot Plug</a></li>
214
- <li><a href="https://www.switch-bot.com/products/switchbot-plug-mini">SwitchBot Plug Mini (US)</a></li>
215
- <li><a href="https://www.switchbot.jp/products/switchbot-plug-mini">SwitchBot Plug Mini (JP)</a>
224
+ <li><a href="https://www.switch-bot.com/products/switchbot-plug" target="_blank" class="external">SwitchBot Plug</a></li>
225
+ <li><a href="https://www.switch-bot.com/products/switchbot-plug-mini" target="_blank" class="external">SwitchBot Plug Mini (US)</a></li>
226
+ <li><a href="https://www.switchbot.jp/products/switchbot-plug-mini" target="_blank" class="external">SwitchBot Plug Mini (JP)</a>
216
227
  <ul>
217
228
  <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
218
229
  <li>If using OpenAPI:
219
230
  <ul>
220
- <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a> Required</li>
231
+ <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini" target="_blank" class="external">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a> Required</li>
221
232
  <li>Enable Cloud Services for Device on SwitchBot App</li>
222
233
  </ul>
223
234
  </li>
224
235
  </ul>
225
236
  </li>
226
- <li><a href="https://www.switch-bot.com/products/switchbot-bot">SwitchBot Bot</a>
237
+ <li><a href="https://www.switch-bot.com/products/switchbot-bot" target="_blank" class="external">SwitchBot Bot</a>
227
238
  <ul>
228
239
  <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
229
240
  <li>If using OpenAPI:
230
241
  <ul>
231
- <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a> Required</li>
242
+ <li><a href="https://www.switch-bot.com/products/switchbot-hub-mini" target="_blank" class="external">SwitchBot Hub Mini</a> or <a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a> Required</li>
232
243
  <li>Enable Cloud Services for Device on SwitchBot App</li>
233
244
  <li>You must set your Bot's Device ID for either Press Mode or Switch Mode in Plugin Config (SwitchBot Device Settings &gt; Bot Settings)
234
245
  <ul>
@@ -251,7 +262,7 @@
251
262
  </li>
252
263
  </ul>
253
264
  </li>
254
- <li><a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a>
265
+ <li><a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a>
255
266
  <ul>
256
267
  <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections
257
268
  <ul>
@@ -260,18 +271,18 @@
260
271
  </li>
261
272
  </ul>
262
273
  </li>
263
- <li><a href="https://us.switch-bot.com/products/switchbot-battery-circulator-fan">SwitchBot Battery Circulator Fan</a>
274
+ <li><a href="https://us.switch-bot.com/products/switchbot-battery-circulator-fan" target="_blank" class="external">SwitchBot Battery Circulator Fan</a>
264
275
  <ul>
265
276
  <li>Supports OpenAPI Connection Only</li>
266
277
  </ul>
267
278
  </li>
268
- <li><a href="https://us.switch-bot.com/products/switchbot-water-leak-detector">SwitchBot Water Leak Detector</a>
279
+ <li><a href="https://us.switch-bot.com/products/switchbot-water-leak-detector" target="_blank" class="external">SwitchBot Water Leak Detector</a>
269
280
  <ul>
270
281
  <li>Supports OpenAPI Connection Only</li>
271
282
  </ul>
272
283
  </li>
273
284
  </ul>
274
- <a id="md:supported-ir-devices" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Supported IR Devices<a href="#md:supported-ir-devices" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="md:all-ir-devices-require-switchbot-hub-2-or-hub-mini" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><em>(All IR Devices require <a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a> or <a href="https://www.switch-bot.com/products/switchbot-hub-mini">Hub Mini</a>)</em><a href="#md:all-ir-devices-require-switchbot-hub-2-or-hub-mini" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul>
285
+ <a id="md:supported-ir-devices" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Supported IR Devices<a href="#md:supported-ir-devices" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="md:all-ir-devices-require-switchbot-hub-2-or-hub-mini" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><em>(All IR Devices require <a href="https://us.switch-bot.com/products/switchbot-hub-2" target="_blank" class="external">SwitchBot Hub 2</a> or <a href="https://www.switch-bot.com/products/switchbot-hub-mini" target="_blank" class="external">Hub Mini</a>)</em><a href="#md:all-ir-devices-require-switchbot-hub-2-or-hub-mini" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul>
275
286
  <li>TV
276
287
  <ul>
277
288
  <li>Allows for On/Off and Volume Controls</li>
@@ -353,16 +364,16 @@
353
364
  </li>
354
365
  </ul>
355
366
  <a id="md:switchbot-apis" class="tsd-anchor"></a><h2 class="tsd-anchor-link">SwitchBot APIs<a href="#md:switchbot-apis" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
356
- <li><a href="https://github.com/OpenWonderLabs/SwitchBotAPI">OpenWonderLabs/SwitchBotAPI</a></li>
357
- <li><a href="https://github.com/OpenWonderLabs/SwitchBotAPI-BLE">OpenWonderLabs/SwitchBotAPI-BLE</a>
367
+ <li><a href="https://github.com/OpenWonderLabs/SwitchBotAPI" target="_blank" class="external">OpenWonderLabs/SwitchBotAPI</a></li>
368
+ <li><a href="https://github.com/OpenWonderLabs/SwitchBotAPI-BLE" target="_blank" class="external">OpenWonderLabs/SwitchBotAPI-BLE</a>
358
369
  <ul>
359
- <li><a href="https://github.com/OpenWonderLabs/node-switchbot">OpenWonderLabs/node-switchbot</a></li>
370
+ <li><a href="https://github.com/OpenWonderLabs/node-switchbot" target="_blank" class="external">OpenWonderLabs/node-switchbot</a></li>
360
371
  </ul>
361
372
  </li>
362
373
  </ul>
363
374
  <a id="md:community" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Community<a href="#md:community" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
364
- <li><a href="https://www.switch-bot.com/">SwitchBot (Official website)</a></li>
365
- <li><a href="https://www.facebook.com/SwitchBotRobot/">Facebook @SwitchBotRobot</a></li>
366
- <li><a href="https://twitter.com/switchbot">Twitter @SwitchBot</a></li>
375
+ <li><a href="https://www.switch-bot.com/" target="_blank" class="external">SwitchBot (Official website)</a></li>
376
+ <li><a href="https://www.facebook.com/SwitchBotRobot/" target="_blank" class="external">Facebook @SwitchBotRobot</a></li>
377
+ <li><a href="https://twitter.com/switchbot" target="_blank" class="external">Twitter @SwitchBot</a></li>
367
378
  </ul>
368
- </div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>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"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:switchbothomebridge-switchbot"><span>@switchbot/homebridge-<wbr/>switchbot</span></a><ul><li><a href="#md:installation"><span>Installation</span></a></li><li><a href="#md:configuration"><span>Configuration</span></a></li><li><ul><li><a href="#md:if-using-openapi-connection"><span>If using <wbr/>OpenAPI <wbr/>Connection</span></a></li><li><a href="#md:if-using-ble-connection"><span>If using BLE <wbr/>Connection</span></a></li></ul></li><li><a href="#md:troubleshooting"><span>Troubleshooting</span></a></li><li><ul><li><a href="#md:if-using-linux--raspberry-pi-os"><span>If using <wbr/>Linux / <wbr/>Raspberry <wbr/>Pi OS</span></a></li></ul></li><li><a href="#md:supported-switchbot-devices"><span>Supported <wbr/>Switch<wbr/>Bot <wbr/>Devices</span></a></li><li><a href="#md:supported-ir-devices"><span>Supported IR <wbr/>Devices</span></a></li><li><ul><li><a href="#md:all-ir-devices-require-switchbot-hub-2-or-hub-mini"><span>(<wbr/>All IR <wbr/>Devices require <wbr/>Switch<wbr/>Bot <wbr/>Hub 2 or <wbr/>Hub <wbr/>Mini)</span></a></li></ul></li><li><a href="#md:switchbot-apis"><span>Switch<wbr/>Bot APIs</span></a></li><li><a href="#md:community"><span>Community</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>@switchbot/homebridge-switchbot</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
379
+ </div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>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"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:switchbothomebridge-switchbot"><span>@switchbot/homebridge-<wbr/>switchbot</span></a><ul><li><a href="#md:installation"><span>Installation</span></a></li><li><a href="#md:configuration"><span>Configuration</span></a></li><li><ul><li><a href="#md:if-using-openapi-connection"><span>If using <wbr/>OpenAPI <wbr/>Connection</span></a></li><li><a href="#md:if-using-ble-connection"><span>If using BLE <wbr/>Connection</span></a></li></ul></li><li><a href="#md:troubleshooting"><span>Troubleshooting</span></a></li><li><ul><li><a href="#md:if-using-linux--raspberry-pi-os"><span>If using <wbr/>Linux / <wbr/>Raspberry <wbr/>Pi OS</span></a></li><li><a href="#md:if-using-macos"><span>If using <wbr/>MacOS</span></a></li></ul></li><li><a href="#md:supported-switchbot-devices"><span>Supported <wbr/>Switch<wbr/>Bot <wbr/>Devices</span></a></li><li><a href="#md:supported-ir-devices"><span>Supported IR <wbr/>Devices</span></a></li><li><ul><li><a href="#md:all-ir-devices-require-switchbot-hub-2-or-hub-mini"><span>(<wbr/>All IR <wbr/>Devices require <wbr/>Switch<wbr/>Bot <wbr/>Hub 2 or <wbr/>Hub <wbr/>Mini)</span></a></li></ul></li><li><a href="#md:switchbot-apis"><span>Switch<wbr/>Bot APIs</span></a></li><li><a href="#md:community"><span>Community</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>@switchbot/homebridge-switchbot</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@switchbot/homebridge-switchbot",
3
3
  "displayName": "SwitchBot",
4
4
  "type": "module",
5
- "version": "3.8.3-beta.3",
5
+ "version": "3.8.3-beta.31",
6
6
  "description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.",
7
7
  "author": "SwitchBot <support@wondertechlabs.com> (https://github.com/SwitchBot)",
8
8
  "contributors": [
@@ -67,7 +67,7 @@
67
67
  "plugin-ui": "rsync ./src/homebridge-ui/public/index.html ./dist/homebridge-ui/public/",
68
68
  "build": "npm run clean && tsc && npm run plugin-ui",
69
69
  "prepublishOnly": "npm run lint && npm run build && npm run plugin-ui ",
70
- "postpublish": "npm run clean",
70
+ "postpublish": "npm run clean && npm ci",
71
71
  "clean": "shx rm -rf ./dist",
72
72
  "test": "npm run lint",
73
73
  "docs": "typedoc",
@@ -80,34 +80,33 @@
80
80
  "@homebridge/plugin-ui-utils": "^1.0.3",
81
81
  "async-mqtt": "^2.6.3",
82
82
  "fakegato-history": "^0.6.5",
83
- "homebridge-lib": "^7.0.8",
84
- "node-switchbot": "2.4.0",
85
- "rxjs": "^7.8.1",
86
- "undici": "^6.19.8"
83
+ "homebridge-lib": "^7.0.9",
84
+ "node-switchbot": "^3.0.0",
85
+ "rxjs": "^7.8.1"
87
86
  },
88
87
  "devDependencies": {
89
- "@antfu/eslint-config": "^3.6.2",
88
+ "@antfu/eslint-config": "^3.7.3",
90
89
  "@types/aes-js": "^3.1.4",
91
90
  "@types/debug": "^4.1.12",
92
91
  "@types/fs-extra": "^11.0.4",
93
92
  "@types/jest": "^29.5.13",
94
93
  "@types/mdast": "^4.0.4",
95
- "@types/node": "^22.5.5",
94
+ "@types/node": "^22.7.4",
96
95
  "@types/semver": "^7.5.8",
97
96
  "@types/source-map-support": "^0.5.10",
98
- "@vitest/coverage-v8": "^2.1.1",
99
- "eslint": "^9.10.0",
97
+ "@vitest/coverage-v8": "^2.1.2",
98
+ "eslint": "^9.12.0",
100
99
  "eslint-plugin-format": "^0.1.2",
101
100
  "homebridge": "^1.8.4",
102
- "homebridge-config-ui-x": "4.58.0",
101
+ "homebridge-config-ui-x": "4.59.1",
103
102
  "jest": "^29.7.0",
104
- "nodemon": "^3.1.6",
105
- "npm-check-updates": "^17.1.2",
103
+ "nodemon": "^3.1.7",
104
+ "npm-check-updates": "^17.1.3",
106
105
  "shx": "^0.3.4",
107
106
  "ts-node": "^10.9.2",
108
- "typedoc": "^0.26.7",
107
+ "typedoc": "^0.26.8",
109
108
  "typescript": "^5.6.2",
110
- "vitest": "^2.1.1"
109
+ "vitest": "^2.1.2"
111
110
  },
112
111
  "directories": {
113
112
  "doc": "docs"
@@ -3,13 +3,10 @@
3
3
  * blindtilt.ts: @switchbot/homebridge-switchbot.
4
4
  */
5
5
  import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
6
+ import type { blindTiltServiceData, blindTiltStatus, blindTiltWebhookContext, bodyChange, device } from 'node-switchbot'
6
7
 
7
8
  import type { SwitchBotPlatform } from '../platform.js'
8
9
  import type { devicesConfig } from '../settings.js'
9
- import type { blindTiltServiceData } from '../types/bledevicestatus.js'
10
- import type { device } from '../types/devicelist.js'
11
- import type { blindTiltStatus } from '../types/devicestatus.js'
12
- import type { blindTiltWebhookContext } from '../types/devicewebhookstatus.js'
13
10
 
14
11
  /*
15
12
  * For Testing Locally:
@@ -244,7 +241,7 @@ export class BlindTilt extends deviceBase {
244
241
  this.debugLog('Retrieve initial values and update Homekit')
245
242
  this.refreshStatus()
246
243
  } catch (e: any) {
247
- this.errorLog(`failed to retrieve initial values and update Homekit, Error: ${e}`)
244
+ this.errorLog(`failed to retrieve initial values and update Homekit, Error: ${e.message ?? e}`)
248
245
  }
249
246
 
250
247
  // regisiter webhook event handler if enabled
@@ -252,7 +249,7 @@ export class BlindTilt extends deviceBase {
252
249
  this.debugLog('Registering Webhook Event Handler')
253
250
  this.registerWebhook()
254
251
  } catch (e: any) {
255
- this.errorLog(`failed to registerWebhook, Error: ${e}`)
252
+ this.errorLog(`failed to registerWebhook, Error: ${e.message ?? e}`)
256
253
  }
257
254
 
258
255
  // regisiter platform BLE event handler if enabled
@@ -260,7 +257,7 @@ export class BlindTilt extends deviceBase {
260
257
  this.debugLog('Registering Platform BLE Event Handler')
261
258
  this.registerPlatformBLE()
262
259
  } catch (e: any) {
263
- this.errorLog(`failed to registerPlatformBLE, Error: ${e}`)
260
+ this.errorLog(`failed to registerPlatformBLE, Error: ${e.message ?? e}`)
264
261
  }
265
262
 
266
263
  // Start an update interval
@@ -457,22 +454,22 @@ export class BlindTilt extends deviceBase {
457
454
 
458
455
  async BLERefreshStatus(): Promise<void> {
459
456
  await this.debugLog('BLERefreshStatus')
460
- const switchbot = await this.switchbotBLE()
461
- if (switchbot === undefined) {
462
- await this.BLERefreshConnection(switchbot)
457
+ const switchBotBLE = await this.switchbotBLE()
458
+ if (switchBotBLE === undefined) {
459
+ await this.BLERefreshConnection(switchBotBLE)
463
460
  } else {
464
461
  // Start to monitor advertisement packets
465
462
  (async () => {
466
463
  // Start to monitor advertisement packets
467
- const serviceData = await this.monitorAdvertisementPackets(switchbot) as blindTiltServiceData
464
+ const serviceData = await this.monitorAdvertisementPackets(switchBotBLE) as blindTiltServiceData
468
465
  // Update HomeKit
469
466
  if (serviceData.model === SwitchBotBLEModel.BlindTilt && serviceData.modelName === SwitchBotBLEModelName.BlindTilt) {
470
467
  this.serviceData = serviceData
471
468
  await this.BLEparseStatus()
472
469
  await this.updateHomeKitCharacteristics()
473
470
  } else {
474
- await this.errorLog(`failed to get serviceData, serviceData: ${serviceData}`)
475
- await this.BLERefreshConnection(switchbot)
471
+ await this.errorLog(`failed to get serviceData, serviceData: ${JSON.stringify(serviceData)}`)
472
+ await this.BLERefreshConnection(switchBotBLE)
476
473
  }
477
474
  })()
478
475
  }
@@ -493,7 +490,7 @@ export class BlindTilt extends deviceBase {
493
490
  await this.BLEparseStatus()
494
491
  await this.updateHomeKitCharacteristics()
495
492
  } catch (e: any) {
496
- await this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e}`)
493
+ await this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
497
494
  }
498
495
  }
499
496
  } catch (error) {
@@ -507,17 +504,17 @@ export class BlindTilt extends deviceBase {
507
504
  async openAPIRefreshStatus(): Promise<void> {
508
505
  await this.debugLog('openAPIRefreshStatus')
509
506
  try {
510
- const { body, statusCode } = await this.deviceRefreshStatus()
511
- const deviceStatus: any = await body.json()
512
- await this.debugLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
513
- if (await this.successfulStatusCodes(statusCode, deviceStatus)) {
514
- await this.debugSuccessLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
507
+ const { body } = await this.deviceRefreshStatus()
508
+ const deviceStatus: any = await body
509
+ await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
510
+ if (await this.successfulStatusCodes(deviceStatus)) {
511
+ await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
515
512
  this.deviceStatus = deviceStatus.body
516
513
  await this.openAPIparseStatus()
517
514
  await this.updateHomeKitCharacteristics()
518
515
  } else {
519
- await this.debugWarnLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
520
- await this.debugWarnLog(statusCode, deviceStatus)
516
+ await this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
517
+ await this.debugWarnLog(deviceStatus)
521
518
  }
522
519
  } catch (e: any) {
523
520
  await this.apiError(e)
@@ -535,7 +532,7 @@ export class BlindTilt extends deviceBase {
535
532
  await this.parseStatusWebhook()
536
533
  await this.updateHomeKitCharacteristics()
537
534
  } catch (e: any) {
538
- await this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e}`)
535
+ await this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
539
536
  }
540
537
  }
541
538
  } else {
@@ -567,15 +564,15 @@ export class BlindTilt extends deviceBase {
567
564
  await this.debugLog('BLEpushChanges')
568
565
  if (this.WindowCovering.TargetPosition !== this.WindowCovering.CurrentPosition) {
569
566
  await this.debugLog(`BLEpushChanges On: ${this.WindowCovering.TargetPosition} OnCached: ${this.WindowCovering.CurrentPosition}`)
570
- const switchbot = await this.platform.connectBLE(this.accessory, this.device)
567
+ const switchBotBLE = await this.platform.connectBLE(this.accessory, this.device)
571
568
  try {
572
569
  const formattedDeviceId = formatDeviceIdAsMac(this.device.deviceId)
573
570
  this.device.bleMac = formattedDeviceId
574
571
  await this.debugLog(`bleMac: ${this.device.bleMac}`)
575
572
  const { setPositionMode, Mode }: { setPositionMode: number, Mode: string } = await this.setPerformance()
576
573
  await this.debugLog(`Mode: ${Mode}, setPositionMode: ${setPositionMode}`)
577
- if (switchbot !== false) {
578
- switchbot
574
+ if (switchBotBLE !== false) {
575
+ switchBotBLE
579
576
  .discover({ model: this.device.bleModel, quick: true, id: this.device.bleMac })
580
577
  .then(async (device_list: any) => {
581
578
  return await this.retryBLE({
@@ -595,7 +592,7 @@ export class BlindTilt extends deviceBase {
595
592
  await this.BLEPushConnection()
596
593
  })
597
594
  } else {
598
- await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`)
595
+ await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${JSON.stringify(switchBotBLE)}`)
599
596
  await this.BLEPushConnection()
600
597
  }
601
598
  } catch (error) {
@@ -617,36 +614,35 @@ export class BlindTilt extends deviceBase {
617
614
  const { Mode, setPositionMode }: { setPositionMode: number, Mode: string } = await this.setPerformance()
618
615
  await this.debugLog(`Pushing ${this.WindowCovering.TargetPosition} (device = ${direction};${position})`)
619
616
  await this.debugLog(`Mode: ${Mode}, setPositionMode: ${setPositionMode}`)
620
- let bodyChange: string
617
+ let bodyChange: bodyChange
621
618
  if (position === 100) {
622
- bodyChange = JSON.stringify({
619
+ bodyChange = {
623
620
  command: 'fullyOpen',
624
621
  parameter: 'default',
625
622
  commandType: 'command',
626
- })
623
+ }
627
624
  } else if (position === 0) {
628
- bodyChange = JSON.stringify({
625
+ bodyChange = {
629
626
  command: direction === 'up' ? 'closeUp' : 'closeDown',
630
627
  parameter: 'default',
631
628
  commandType: 'command',
632
- })
629
+ }
633
630
  } else {
634
- bodyChange = JSON.stringify({
631
+ bodyChange = {
635
632
  command: 'setPosition',
636
633
  parameter: `${direction};${position}`,
637
634
  commandType: 'command',
638
- })
635
+ }
639
636
  }
640
637
  await this.debugLog(`SwitchBot OpenAPI bodyChange: ${JSON.stringify(bodyChange)}`)
641
638
  try {
642
- const { body, statusCode } = await this.pushChangeRequest(bodyChange)
643
- const deviceStatus: any = await body.json()
644
- await this.debugLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
645
- if (await this.successfulStatusCodes(statusCode, deviceStatus)) {
646
- await this.debugSuccessLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
639
+ const { body } = await this.pushChangeRequest(bodyChange)
640
+ const deviceStatus: any = await body
641
+ await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
642
+ if (await this.successfulStatusCodes(deviceStatus)) {
643
+ await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
647
644
  await this.updateHomeKitCharacteristics()
648
645
  } else {
649
- await this.statusCode(statusCode)
650
646
  await this.statusCode(deviceStatus.statusCode)
651
647
  }
652
648
  } catch (e: any) {