@switchbot/homebridge-switchbot 3.6.1-beta.8 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/CHANGELOG.md +2 -1
  2. package/dist/device/blindtilt.js +3 -3
  3. package/dist/device/blindtilt.js.map +1 -1
  4. package/dist/device/bot.js +12 -12
  5. package/dist/device/bot.js.map +1 -1
  6. package/dist/device/ceilinglight.js +1 -1
  7. package/dist/device/ceilinglight.js.map +1 -1
  8. package/dist/device/colorbulb.js +1 -1
  9. package/dist/device/colorbulb.js.map +1 -1
  10. package/dist/device/contact.js +4 -4
  11. package/dist/device/contact.js.map +1 -1
  12. package/dist/device/curtain.js +3 -3
  13. package/dist/device/curtain.js.map +1 -1
  14. package/dist/device/device.d.ts +1 -9
  15. package/dist/device/device.d.ts.map +1 -1
  16. package/dist/device/device.js +14 -38
  17. package/dist/device/device.js.map +1 -1
  18. package/dist/device/fan.js +3 -3
  19. package/dist/device/fan.js.map +1 -1
  20. package/dist/device/hub.js +3 -3
  21. package/dist/device/hub.js.map +1 -1
  22. package/dist/device/humidifier.js +2 -2
  23. package/dist/device/humidifier.js.map +1 -1
  24. package/dist/device/iosensor.js +3 -3
  25. package/dist/device/iosensor.js.map +1 -1
  26. package/dist/device/lightstrip.js +1 -1
  27. package/dist/device/lightstrip.js.map +1 -1
  28. package/dist/device/lock.js +4 -4
  29. package/dist/device/lock.js.map +1 -1
  30. package/dist/device/meter.js +3 -3
  31. package/dist/device/meter.js.map +1 -1
  32. package/dist/device/meterplus.js +3 -3
  33. package/dist/device/meterplus.js.map +1 -1
  34. package/dist/device/motion.d.ts.map +1 -1
  35. package/dist/device/motion.js +4 -5
  36. package/dist/device/motion.js.map +1 -1
  37. package/dist/device/plug.js +2 -2
  38. package/dist/device/plug.js.map +1 -1
  39. package/dist/device/robotvacuumcleaner.js +3 -3
  40. package/dist/device/robotvacuumcleaner.js.map +1 -1
  41. package/dist/device/waterdetector.js +2 -2
  42. package/dist/device/waterdetector.js.map +1 -1
  43. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  44. package/dist/irdevice/airconditioner.js +4 -3
  45. package/dist/irdevice/airconditioner.js.map +1 -1
  46. package/dist/irdevice/airpurifier.js +2 -2
  47. package/dist/irdevice/airpurifier.js.map +1 -1
  48. package/dist/irdevice/camera.js +1 -1
  49. package/dist/irdevice/camera.js.map +1 -1
  50. package/dist/irdevice/fan.js +1 -1
  51. package/dist/irdevice/fan.js.map +1 -1
  52. package/dist/irdevice/irdevice.d.ts +1 -0
  53. package/dist/irdevice/irdevice.d.ts.map +1 -1
  54. package/dist/irdevice/irdevice.js +14 -11
  55. package/dist/irdevice/irdevice.js.map +1 -1
  56. package/dist/irdevice/light.js +3 -3
  57. package/dist/irdevice/light.js.map +1 -1
  58. package/dist/irdevice/other.d.ts +1 -1
  59. package/dist/irdevice/other.d.ts.map +1 -1
  60. package/dist/irdevice/other.js +26 -36
  61. package/dist/irdevice/other.js.map +1 -1
  62. package/dist/irdevice/tv.js +3 -3
  63. package/dist/irdevice/tv.js.map +1 -1
  64. package/dist/irdevice/vacuumcleaner.js +1 -1
  65. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  66. package/dist/irdevice/waterheater.js +2 -2
  67. package/dist/irdevice/waterheater.js.map +1 -1
  68. package/dist/platform.d.ts +9 -0
  69. package/dist/platform.d.ts.map +1 -1
  70. package/dist/platform.js +319 -91
  71. package/dist/platform.js.map +1 -1
  72. package/dist/settings.d.ts +1 -1
  73. package/dist/settings.d.ts.map +1 -1
  74. package/docs/.nojekyll +1 -0
  75. package/docs/assets/highlight.css +22 -0
  76. package/docs/assets/icons.js +18 -0
  77. package/docs/assets/icons.svg +1 -0
  78. package/docs/assets/main.js +60 -0
  79. package/docs/assets/navigation.js +1 -0
  80. package/docs/assets/search.js +1 -0
  81. package/docs/assets/style.css +1448 -0
  82. package/docs/functions/default.html +1 -0
  83. package/docs/index.html +368 -0
  84. package/docs/modules.html +2 -0
  85. package/package.json +10 -7
  86. package/src/device/blindtilt.ts +3 -3
  87. package/src/device/bot.ts +12 -12
  88. package/src/device/ceilinglight.ts +1 -1
  89. package/src/device/colorbulb.ts +1 -1
  90. package/src/device/contact.ts +4 -4
  91. package/src/device/curtain.ts +3 -3
  92. package/src/device/device.ts +15 -44
  93. package/src/device/fan.ts +3 -3
  94. package/src/device/hub.ts +3 -3
  95. package/src/device/humidifier.ts +2 -2
  96. package/src/device/iosensor.ts +3 -3
  97. package/src/device/lightstrip.ts +1 -1
  98. package/src/device/lock.ts +4 -4
  99. package/src/device/meter.ts +4 -4
  100. package/src/device/meterplus.ts +4 -4
  101. package/src/device/motion.ts +6 -7
  102. package/src/device/plug.ts +2 -2
  103. package/src/device/robotvacuumcleaner.ts +3 -3
  104. package/src/device/waterdetector.ts +2 -2
  105. package/src/irdevice/airconditioner.ts +5 -4
  106. package/src/irdevice/airpurifier.ts +2 -2
  107. package/src/irdevice/camera.ts +1 -1
  108. package/src/irdevice/fan.ts +1 -1
  109. package/src/irdevice/irdevice.ts +15 -11
  110. package/src/irdevice/light.ts +3 -3
  111. package/src/irdevice/other.ts +26 -34
  112. package/src/irdevice/tv.ts +3 -3
  113. package/src/irdevice/vacuumcleaner.ts +1 -1
  114. package/src/irdevice/waterheater.ts +2 -2
  115. package/src/platform.ts +324 -90
  116. package/src/settings.ts +1 -1
  117. package/typedoc.json +17 -0
  118. package/.github/npm-version-script.cjs +0 -81
@@ -0,0 +1 @@
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>default | @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"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@switchbot/homebridge-switchbot</a></li><li><a href="default.html">default</a></li></ul><h1>Function default</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="default" class="tsd-anchor"></a><span class="tsd-kind-call-signature">default</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">api</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li 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">api</span>: <span class="tsd-signature-type">API</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/homebridge-switchbot/blob/8bb3faecdfed24721e3940dd8652587017c0ec77/src/index.ts#L11">index.ts:11</a></li></ul></aside></li></ul></section></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></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><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>
@@ -0,0 +1,368 @@
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
+ <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>
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>.
8
+ </p>
9
+ </span>
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>
12
+ <li>Find: <code>@switchbot/homebridge-switchbot</code>
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>
15
+ </ul>
16
+ </li>
17
+ <li>Click <strong>Install</strong></li>
18
+ </ol>
19
+ <a id="md:configuration" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Configuration<a href="#md:configuration" 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>
20
+ <li>
21
+ <a id="md:if-using-openapi-connection" class="tsd-anchor"></a><h3 class="tsd-anchor-link">If using OpenAPI Connection<a href="#md:if-using-openapi-connection" 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>
22
+ <li>Download SwitchBot App on App Store or Google Play Store</li>
23
+ <li>Register a SwitchBot account and log in into your account</li>
24
+ <li>Generate an Token within the App
25
+ <ul>
26
+ <li>Click Bottom Profile Tab</li>
27
+ <li>Click Preference</li>
28
+ <li>Click App version 10 Times, this will enable Developer Options</li>
29
+ <li>Click Developer Options</li>
30
+ <li>Click Copy <code>token</code> to Clipboard</li>
31
+ </ul>
32
+ </li>
33
+ <li>Input your <code>token</code> into the config parameter</li>
34
+ <li>Generate an Secret within the App
35
+ <ul>
36
+ <li>Click Bottom Profile Tab</li>
37
+ <li>Click Preference</li>
38
+ <li>Click App version 10 Times, this will enable Developer Options</li>
39
+ <li>Click Developer Options</li>
40
+ <li>Click Copy <code>secret</code> to Clipboard</li>
41
+ </ul>
42
+ </li>
43
+ <li>Input your <code>secret</code> into the config parameter</li>
44
+ </ol>
45
+ </li>
46
+ <li>
47
+ <a id="md:if-using-ble-connection" class="tsd-anchor"></a><h3 class="tsd-anchor-link">If using BLE Connection<a href="#md:if-using-ble-connection" 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>
48
+ <li>Download SwitchBot App on App Store or Google Play Store</li>
49
+ <li>Register a SwitchBot account and log in into your account</li>
50
+ <li>Click on Device wanting to connect too plugin
51
+ <ul>
52
+ <li>Click the Settings Gear</li>
53
+ <li>Click Device Info</li>
54
+ <li>Copy BLE Mac aka <code>deviceId</code></li>
55
+ </ul>
56
+ </li>
57
+ <li>Input your <code>deviceId</code> into the Device Config</li>
58
+ </ol>
59
+ </li>
60
+ </ul>
61
+ <a id="md:troubleshooting" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Troubleshooting<a href="#md:troubleshooting" 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>
62
+ <li>
63
+ <a id="md:if-using-linux--raspberry-pi-os" class="tsd-anchor"></a><h3 class="tsd-anchor-link">If using Linux / Raspberry Pi OS<a href="#md:if-using-linux--raspberry-pi-os" 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>
64
+ <li>
65
+ <p><code>bluetoothctl</code> must be installed on the device, otherwise it cannot communicate via Bluetooth. Enable it with <code>sudo bluetoothctl power on</code>.</p>
66
+ </li>
67
+ <li>
68
+ <p>If errors occur, while enabling it, restart the process:</p>
69
+ <ul>
70
+ <li><code>rfkill block bluetooth</code></li>
71
+ <li><code>rfkill unblock bluetooth</code></li>
72
+ </ul>
73
+ </li>
74
+ <li>
75
+ <p>Also make sure, that the computer can discover the SwitchBot device:</p>
76
+ <ul>
77
+ <li><code>sudo bluetoothctl</code></li>
78
+ <li><code>scan on</code></li>
79
+ </ul>
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
+ </li>
82
+ </ol>
83
+ </li>
84
+ </ul>
85
+ <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>
87
+ <ul>
88
+ <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections
89
+ <ul>
90
+ <li>Can Push Updates over OpenAPI</li>
91
+ <li>Can Receive Updates over BLE and OpenAPI</li>
92
+ </ul>
93
+ </li>
94
+ </ul>
95
+ </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>
100
+ <ul>
101
+ <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
102
+ <li>If using OpenAPI:
103
+ <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>
105
+ <li>Enable Cloud Services for Device on SwitchBot App</li>
106
+ </ul>
107
+ </li>
108
+ <li>If using Bluetooth Low Energy (BLE) only:
109
+ <ul>
110
+ <li>Must supply <code>deviceId</code> &amp; <code>deviceName</code> to Device Config</li>
111
+ <li>Check <code>Enable Bluetooth Low Energy (BLE) Connection</code> on Device Config</li>
112
+ </ul>
113
+ </li>
114
+ </ul>
115
+ </li>
116
+ <li><a href="https://www.switch-bot.com/products/motion-sensor">SwitchBot Motion Sensor</a>
117
+ <ul>
118
+ <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
119
+ <li>If using OpenAPI:
120
+ <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>
122
+ <li>Enable Cloud Services for Device on SwitchBot App</li>
123
+ </ul>
124
+ </li>
125
+ <li>If using Bluetooth Low Energy (BLE) only:
126
+ <ul>
127
+ <li>Must supply <code>deviceId</code> &amp; <code>deviceName</code> to Device Config</li>
128
+ <li>Check <code>Enable Bluetooth Low Energy (BLE) Connection</code> on Device Config</li>
129
+ </ul>
130
+ </li>
131
+ </ul>
132
+ </li>
133
+ <li><a href="https://www.switch-bot.com/products/contact-sensor">SwitchBot Contact Sensor</a>
134
+ <ul>
135
+ <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
136
+ <li>If using OpenAPI:
137
+ <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>
139
+ <li>Enable Cloud Services for Device on SwitchBot App</li>
140
+ </ul>
141
+ </li>
142
+ <li>If using Bluetooth Low Energy (BLE) only:
143
+ <ul>
144
+ <li>Must supply <code>deviceId</code> &amp; <code>deviceName</code> to Device Config</li>
145
+ <li>Check <code>Enable Bluetooth Low Energy (BLE) Connection</code> on Device Config</li>
146
+ </ul>
147
+ </li>
148
+ </ul>
149
+ </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>
152
+ <ul>
153
+ <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
154
+ <li>If using OpenAPI:
155
+ <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>
157
+ <li>Enable Cloud Services for Device on SwitchBot App</li>
158
+ </ul>
159
+ </li>
160
+ <li>If using Bluetooth Low Energy (BLE) only:
161
+ <ul>
162
+ <li>Must supply <code>deviceId</code> &amp; <code>deviceName</code> to Device Config</li>
163
+ <li>Check <code>Enable Bluetooth Low Energy (BLE) Connection</code> on Device Config</li>
164
+ </ul>
165
+ </li>
166
+ </ul>
167
+ </li>
168
+ <li><a href="https://us.switch-bot.com/products/switchbot-blind-tilt">SwitchBot Blind Tilt</a>
169
+ <ul>
170
+ <li>Supports OpenAPI &amp; partial Bluetooth Low Energy (BLE) Connections</li>
171
+ <li>If using OpenAPI:
172
+ <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>
174
+ <li>Enable Cloud Services for Device on SwitchBot App</li>
175
+ </ul>
176
+ </li>
177
+ </ul>
178
+ </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>
183
+ <ul>
184
+ <li>Supports OpenAPI &amp; partial Bluetooth Low Energy (BLE) Connections</li>
185
+ <li>If using OpenAPI:
186
+ <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>
188
+ <li>Enable Cloud Services for Device on SwitchBot App</li>
189
+ </ul>
190
+ </li>
191
+ </ul>
192
+ </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>
195
+ <ul>
196
+ <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
197
+ <li>If using OpenAPI:
198
+ <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>
200
+ <li>Enable Cloud Services for Device on SwitchBot App</li>
201
+ </ul>
202
+ </li>
203
+ </ul>
204
+ </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>
209
+ <ul>
210
+ <li>Supports OpenAPI Connection Only</li>
211
+ </ul>
212
+ </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>
216
+ <ul>
217
+ <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
218
+ <li>If using OpenAPI:
219
+ <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>
221
+ <li>Enable Cloud Services for Device on SwitchBot App</li>
222
+ </ul>
223
+ </li>
224
+ </ul>
225
+ </li>
226
+ <li><a href="https://www.switch-bot.com/products/switchbot-bot">SwitchBot Bot</a>
227
+ <ul>
228
+ <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections</li>
229
+ <li>If using OpenAPI:
230
+ <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>
232
+ <li>Enable Cloud Services for Device on SwitchBot App</li>
233
+ <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
+ <ul>
235
+ <li>Press Mode - Turns on then instantly turn it off</li>
236
+ <li>Switch Mode - Turns on and keep it on until it is turned off
237
+ <ul>
238
+ <li>This can get out of sync, since API doesn't give me a status</li>
239
+ <li>To Correct you must go into the SwitchBot App and correct the status of either <code>On</code> or <code>Off</code></li>
240
+ </ul>
241
+ </li>
242
+ </ul>
243
+ </li>
244
+ </ul>
245
+ </li>
246
+ <li>If using Bluetooth Low Energy (BLE) only:
247
+ <ul>
248
+ <li>Must supply <code>deviceId</code> &amp; <code>deviceName</code> to Device Config</li>
249
+ <li>Check <code>Enable Bluetooth Low Energy (BLE) Connection</code> on Device Config</li>
250
+ </ul>
251
+ </li>
252
+ </ul>
253
+ </li>
254
+ <li><a href="https://us.switch-bot.com/products/switchbot-hub-2">SwitchBot Hub 2</a>
255
+ <ul>
256
+ <li>Supports OpenAPI &amp; Bluetooth Low Energy (BLE) Connections
257
+ <ul>
258
+ <li>Enables Humidity, Temperature, and Light Sensor</li>
259
+ </ul>
260
+ </li>
261
+ </ul>
262
+ </li>
263
+ <li><a href="https://us.switch-bot.com/products/switchbot-battery-circulator-fan">SwitchBot Battery Circulator Fan</a>
264
+ <ul>
265
+ <li>Supports OpenAPI Connection Only</li>
266
+ </ul>
267
+ </li>
268
+ <li><a href="https://us.switch-bot.com/products/switchbot-water-leak-detector">SwitchBot Water Leak Detector</a>
269
+ <ul>
270
+ <li>Supports OpenAPI Connection Only</li>
271
+ </ul>
272
+ </li>
273
+ </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>
275
+ <li>TV
276
+ <ul>
277
+ <li>Allows for On/Off and Volume Controls</li>
278
+ <li>Optional Disable Sending Power Command</li>
279
+ </ul>
280
+ </li>
281
+ <li>Projector (Displayed as TV)
282
+ <ul>
283
+ <li>Allows for On/Off and Volume Controls</li>
284
+ </ul>
285
+ </li>
286
+ <li>Set Top Box (Displayed as Set Top Box)
287
+ <ul>
288
+ <li>Allows for On/Off and Volume Controls</li>
289
+ </ul>
290
+ </li>
291
+ <li>DVD (Displayed as Set Top Box)
292
+ <ul>
293
+ <li>Allows for On/Off and Volume Controls</li>
294
+ </ul>
295
+ </li>
296
+ <li>Streamer (Displayed as Streaming Stick)
297
+ <ul>
298
+ <li>Allows for On/Off and Volume Controls</li>
299
+ </ul>
300
+ </li>
301
+ <li>Speaker (Displayed as Speaker)
302
+ <ul>
303
+ <li>Allows for On/Off and Volume Controls</li>
304
+ </ul>
305
+ </li>
306
+ <li>Fans
307
+ <ul>
308
+ <li>Allows for On/Off Controls</li>
309
+ <li>Optional Rotation Speed</li>
310
+ <li>Optional Swing Mode</li>
311
+ </ul>
312
+ </li>
313
+ <li>Lights
314
+ <ul>
315
+ <li>Allows for On/Off Controls</li>
316
+ </ul>
317
+ </li>
318
+ <li>Air Purifiers
319
+ <ul>
320
+ <li>Allows for On/Off Controls</li>
321
+ </ul>
322
+ </li>
323
+ <li>Air Conditioners
324
+ <ul>
325
+ <li>Allows for On/Off, Tempeture, and Mode Controls</li>
326
+ <li>Optional Disable Auto Mode</li>
327
+ </ul>
328
+ </li>
329
+ <li>Cameras
330
+ <ul>
331
+ <li>Allows for On/Off Controls</li>
332
+ </ul>
333
+ </li>
334
+ <li>Vacuum Cleaners
335
+ <ul>
336
+ <li>Allows for On/Off Controls</li>
337
+ </ul>
338
+ </li>
339
+ <li>Water Heaters
340
+ <ul>
341
+ <li>Allows for On/Off Controls</li>
342
+ </ul>
343
+ </li>
344
+ <li>Others
345
+ <ul>
346
+ <li>Option to Display as differenet Device Type
347
+ <ul>
348
+ <li>Supports Fan Device Type</li>
349
+ </ul>
350
+ </li>
351
+ <li>Allows for On/Off Controls</li>
352
+ </ul>
353
+ </li>
354
+ </ul>
355
+ <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>
358
+ <ul>
359
+ <li><a href="https://github.com/OpenWonderLabs/node-switchbot">OpenWonderLabs/node-switchbot</a></li>
360
+ </ul>
361
+ </li>
362
+ </ul>
363
+ <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>
367
+ </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>
@@ -0,0 +1,2 @@
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><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><h3 class="tsd-index-heading uppercase">Index</h3><section class="tsd-index-section"><h3 class="tsd-index-heading">Functions</h3><div class="tsd-index-list"><a href="functions/default.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>default</span></a>
2
+ </div></section></section></section></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></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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "SwitchBot",
3
3
  "name": "@switchbot/homebridge-switchbot",
4
- "version": "3.6.1-beta.8",
4
+ "version": "3.7.0",
5
5
  "description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.",
6
6
  "author": {
7
7
  "name": "SwitchBot",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "engineStrict": true,
28
28
  "engines": {
29
- "homebridge": "^1.8.4-beta.21",
29
+ "homebridge": "^1.8.4 || ^2.0.0-alpha.0",
30
30
  "node": "^18 || ^20 || ^22"
31
31
  },
32
32
  "main": "dist/index.js",
@@ -40,7 +40,9 @@
40
40
  "prepublishOnly": "npm run lint && npm run build && npm run plugin-ui ",
41
41
  "postpublish": "npm run clean",
42
42
  "clean": "rimraf ./dist",
43
- "test": "npm run lint"
43
+ "test": "npm run lint",
44
+ "docs": "typedoc",
45
+ "lint-docs": "typedoc --emit none --treatWarningsAsErrors"
44
46
  },
45
47
  "funding": [
46
48
  {
@@ -85,22 +87,23 @@
85
87
  "undici": "^6.19.2"
86
88
  },
87
89
  "optionalDependencies": {
88
- "node-switchbot": "2.2.1-beta.2"
90
+ "node-switchbot": "2.3.0"
89
91
  },
90
92
  "devDependencies": {
91
93
  "@eslint/js": "^9.7.0",
92
94
  "@stylistic/eslint-plugin": "^2.3.0",
93
95
  "@types/eslint__js": "^8.42.3",
94
- "@types/node": "^20.14.10",
96
+ "@types/node": "^20.14.11",
95
97
  "eslint": "^9.7.0",
96
98
  "globals": "^15.8.0",
97
- "homebridge": "^1.8.4-beta.21",
99
+ "homebridge": "^1.8.4",
98
100
  "homebridge-config-ui-x": "4.56.4",
99
101
  "nodemon": "^3.1.4",
100
102
  "npm-check-updates": "^16.14.20",
101
103
  "rimraf": "^6.0.1",
102
104
  "ts-node": "^10.9.2",
105
+ "typedoc": "^0.26.5",
103
106
  "typescript": "^5.5.3",
104
- "typescript-eslint": "^8.0.0-alpha.42"
107
+ "typescript-eslint": "^8.0.0-alpha.44"
105
108
  }
106
109
  }
@@ -81,7 +81,7 @@ export class BlindTilt extends deviceBase {
81
81
  // Initialize WindowCovering Service
82
82
  accessory.context.WindowCovering = accessory.context.WindowCovering ?? {};
83
83
  this.WindowCovering = {
84
- Name: accessory.context.WindowCovering.Name ?? accessory.displayName,
84
+ Name: accessory.displayName,
85
85
  Service: accessory.getService(this.hap.Service.WindowCovering) ?? accessory.addService(this.hap.Service.WindowCovering) as Service,
86
86
  PositionState: accessory.context.PositionState ?? this.hap.Characteristic.PositionState.STOPPED,
87
87
  TargetPosition: accessory.context.TargetPosition ?? 100,
@@ -147,7 +147,7 @@ export class BlindTilt extends deviceBase {
147
147
  // Initialize Battery Service
148
148
  accessory.context.Battery = accessory.context.Battery ?? {};
149
149
  this.Battery = {
150
- Name: accessory.context.Battery.Name ?? `${accessory.displayName} Battery`,
150
+ Name: `${accessory.displayName} Battery`,
151
151
  Service: accessory.getService(this.hap.Service.Battery) ?? accessory.addService(this.hap.Service.Battery) as Service,
152
152
  BatteryLevel: accessory.context.BatteryLevel ?? 100,
153
153
  StatusLowBattery: this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL,
@@ -173,7 +173,7 @@ export class BlindTilt extends deviceBase {
173
173
  } else {
174
174
  accessory.context.LightSensor = accessory.context.LightSensor ?? {};
175
175
  this.LightSensor = {
176
- Name: accessory.context.LightSensor.Name ?? `${accessory.displayName} Light Sensor`,
176
+ Name: `${accessory.displayName} Light Sensor`,
177
177
  Service: accessory.getService(this.hap.Service.LightSensor) ?? accessory.addService(this.hap.Service.LightSensor) as Service,
178
178
  CurrentAmbientLightLevel: accessory.context.CurrentAmbientLightLevel ?? 0.0001,
179
179
  };
package/src/device/bot.ts CHANGED
@@ -115,10 +115,10 @@ export class Bot extends deviceBase {
115
115
  this.doBotUpdate = new Subject();
116
116
  this.botUpdateInProgress = false;
117
117
 
118
- accessory.context.Battery = accessory.context.Battery ?? {};
119
118
  // Initialize Battery property
119
+ accessory.context.Battery = accessory.context.Battery ?? {};
120
120
  this.Battery = {
121
- Name: accessory.context.Battery.Name ?? `${accessory.displayName} Battery`,
121
+ Name: `${accessory.displayName} Battery`,
122
122
  Service: accessory.getService(this.hap.Service.Battery) ?? accessory.addService(this.hap.Service.Battery) as Service,
123
123
  BatteryLevel: accessory.context.BatteryLevel ?? 100,
124
124
  StatusLowBattery: accessory.context.StatusLowBattery ?? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL,
@@ -137,7 +137,7 @@ export class Bot extends deviceBase {
137
137
  // Initialize Switch Service
138
138
  accessory.context.Switch = accessory.context.Switch ?? {};
139
139
  this.Switch = {
140
- Name: accessory.context.Switch.Name ?? accessory.displayName,
140
+ Name: accessory.displayName,
141
141
  Service: accessory.getService(this.hap.Service.Switch) ?? accessory.addService(this.hap.Service.Switch) as Service,
142
142
  };
143
143
  accessory.context.Switch = this.Switch as object;
@@ -163,7 +163,7 @@ export class Bot extends deviceBase {
163
163
  // Initialize GarageDoor Service
164
164
  accessory.context.GarageDoor = accessory.context.GarageDoor ?? {};
165
165
  this.GarageDoor = {
166
- Name: accessory.context.GarageDoor.Name ?? accessory.displayName,
166
+ Name: accessory.displayName,
167
167
  Service: accessory.getService(this.hap.Service.GarageDoorOpener) ?? accessory.addService(this.hap.Service.GarageDoorOpener) as Service,
168
168
  };
169
169
  accessory.context.GarageDoor = this.GarageDoor as object;
@@ -196,7 +196,7 @@ export class Bot extends deviceBase {
196
196
  // Initialize Door Service
197
197
  accessory.context.Door = accessory.context.Door ?? {};
198
198
  this.Door = {
199
- Name: accessory.context.Door.Name ?? accessory.displayName,
199
+ Name: accessory.displayName,
200
200
  Service: accessory.getService(this.hap.Service.Door) ?? accessory.addService(this.hap.Service.Door) as Service,
201
201
  };
202
202
  accessory.context.Door = this.Door as object;
@@ -228,7 +228,7 @@ export class Bot extends deviceBase {
228
228
  // Initialize Window Service
229
229
  accessory.context.Window = accessory.context.Window ?? {};
230
230
  this.Window = {
231
- Name: accessory.context.Window.Name ?? accessory.displayName,
231
+ Name: accessory.displayName,
232
232
  Service: accessory.getService(this.hap.Service.Window) ?? accessory.addService(this.hap.Service.Window) as Service,
233
233
  };
234
234
  accessory.context.Window = this.Window as object;
@@ -260,7 +260,7 @@ export class Bot extends deviceBase {
260
260
  // Initialize WindowCovering Service
261
261
  accessory.context.WindowCovering = accessory.context.WindowCovering ?? {};
262
262
  this.WindowCovering = {
263
- Name: accessory.context.WindowCovering.Name ?? accessory.displayName,
263
+ Name: accessory.displayName,
264
264
  Service: accessory.getService(this.hap.Service.WindowCovering) ?? accessory.addService(this.hap.Service.WindowCovering) as Service,
265
265
  };
266
266
  accessory.context.WindowCovering = this.WindowCovering as object;
@@ -293,7 +293,7 @@ export class Bot extends deviceBase {
293
293
  // Initialize Lock Service
294
294
  accessory.context.LockMechanism = accessory.context.LockMechanism ?? {};
295
295
  this.LockMechanism = {
296
- Name: accessory.context.LockMechanism.Name ?? accessory.displayName,
296
+ Name: accessory.displayName,
297
297
  Service: accessory.getService(this.hap.Service.LockMechanism) ?? accessory.addService(this.hap.Service.LockMechanism) as Service,
298
298
  };
299
299
  accessory.context.LockMechanism = this.LockMechanism as object;
@@ -320,7 +320,7 @@ export class Bot extends deviceBase {
320
320
  // Initialize Faucet Service
321
321
  accessory.context.Faucet = accessory.context.Faucet ?? {};
322
322
  this.Faucet = {
323
- Name: accessory.context.Faucet.Name ?? accessory.displayName,
323
+ Name: accessory.displayName,
324
324
  Service: accessory.getService(this.hap.Service.Faucet) ?? accessory.addService(this.hap.Service.Faucet) as Service,
325
325
  };
326
326
  accessory.context.Faucet = this.Faucet as object;
@@ -346,7 +346,7 @@ export class Bot extends deviceBase {
346
346
  // Initialize Fan Service
347
347
  accessory.context.Fan = accessory.context.Fan ?? {};
348
348
  this.Fan = {
349
- Name: accessory.context.Fan.Name ?? accessory.displayName,
349
+ Name: accessory.displayName,
350
350
  Service: accessory.getService(this.hap.Service.Fanv2) ?? accessory.addService(this.hap.Service.Fanv2) as Service,
351
351
  };
352
352
  accessory.context.Fan = this.Fan as object;
@@ -372,7 +372,7 @@ export class Bot extends deviceBase {
372
372
  // Initialize StatefulProgrammableSwitch Service
373
373
  accessory.context.StatefulProgrammableSwitch = accessory.context.StatefulProgrammableSwitch ?? {};
374
374
  this.StatefulProgrammableSwitch = {
375
- Name: accessory.context.StatefulProgrammableSwitch.Name ?? accessory.displayName,
375
+ Name: accessory.displayName,
376
376
  Service: accessory.getService(this.hap.Service.StatefulProgrammableSwitch)
377
377
  ?? accessory.addService(this.hap.Service.StatefulProgrammableSwitch) as Service,
378
378
  };
@@ -399,7 +399,7 @@ export class Bot extends deviceBase {
399
399
  // Initialize Switch property
400
400
  accessory.context.Outlet = accessory.context.Outlet ?? {};
401
401
  this.Outlet = {
402
- Name: accessory.context.Outlet.Name ?? accessory.displayName,
402
+ Name: accessory.displayName,
403
403
  Service: accessory.getService(this.hap.Service.Outlet) ?? accessory.addService(this.hap.Service.Outlet) as Service,
404
404
  };
405
405
  accessory.context.Outlet = this.Outlet as object;
@@ -69,7 +69,7 @@ export class CeilingLight extends deviceBase {
69
69
  // Initialize LightBulb Service
70
70
  accessory.context.LightBulb = accessory.context.LightBulb ?? {};
71
71
  this.LightBulb = {
72
- Name: accessory.context.LightBulb.Name ?? accessory.displayName,
72
+ Name: accessory.displayName,
73
73
  Service: accessory.getService(this.hap.Service.Lightbulb) ?? accessory.addService(this.hap.Service.Lightbulb) as Service,
74
74
  On: accessory.context.On ?? false,
75
75
  Hue: accessory.context.Hue ?? 0,
@@ -69,7 +69,7 @@ export class ColorBulb extends deviceBase {
69
69
  // Initialize LightBulb property
70
70
  accessory.context.LightBulb = accessory.context.LightBulb ?? {};
71
71
  this.LightBulb = {
72
- Name: accessory.context.LightBulb.Name ?? accessory.displayName,
72
+ Name: accessory.displayName,
73
73
  Service: accessory.getService(this.hap.Service.Lightbulb) ?? accessory.addService(this.hap.Service.Lightbulb) as Service,
74
74
  On: accessory.context.On ?? false,
75
75
  Hue: accessory.context.Hue ?? 0,