@switchbot/homebridge-switchbot 5.0.0-beta.1 → 5.0.0-beta.100

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 (448) hide show
  1. package/.github/ISSUE_TEMPLATE/e2e-verification.md +36 -0
  2. package/.github/workflows/ci.yml +32 -0
  3. package/.github/workflows/manual-e2e.yml +115 -0
  4. package/.github/workflows/release.yml +0 -4
  5. package/CHANGELOG.md +35 -0
  6. package/E2E-VERIFICATION.md +121 -0
  7. package/MIGRATION.md +44 -0
  8. package/README.md +56 -3
  9. package/config.schema.json +91 -14787
  10. package/dist/deviceFactory.d.ts +13 -0
  11. package/dist/deviceFactory.d.ts.map +1 -0
  12. package/dist/deviceFactory.js +81 -0
  13. package/dist/deviceFactory.js.map +1 -0
  14. package/dist/devices/deviceBase.d.ts +50 -0
  15. package/dist/devices/deviceBase.d.ts.map +1 -0
  16. package/dist/devices/deviceBase.js +119 -0
  17. package/dist/devices/deviceBase.js.map +1 -0
  18. package/dist/devices/genericDevice.d.ts +298 -0
  19. package/dist/devices/genericDevice.d.ts.map +1 -0
  20. package/dist/devices/genericDevice.js +1065 -0
  21. package/dist/devices/genericDevice.js.map +1 -0
  22. package/dist/homebridge-ui/public/index.html +636 -246
  23. package/dist/homebridge-ui/server.d.ts +3 -1
  24. package/dist/homebridge-ui/server.d.ts.map +1 -1
  25. package/dist/homebridge-ui/server.js +467 -36
  26. package/dist/homebridge-ui/server.js.map +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +4 -7
  29. package/dist/index.js.map +1 -1
  30. package/dist/platform.d.ts +35 -0
  31. package/dist/platform.d.ts.map +1 -0
  32. package/dist/platform.js +1562 -0
  33. package/dist/platform.js.map +1 -0
  34. package/dist/settings.d.ts +10 -249
  35. package/dist/settings.d.ts.map +1 -1
  36. package/dist/settings.js +5 -30
  37. package/dist/settings.js.map +1 -1
  38. package/dist/switchbotClient.d.ts +32 -0
  39. package/dist/switchbotClient.d.ts.map +1 -0
  40. package/dist/switchbotClient.js +194 -0
  41. package/dist/switchbotClient.js.map +1 -0
  42. package/dist/utils.d.ts +39 -50
  43. package/dist/utils.d.ts.map +1 -1
  44. package/dist/utils.js +39 -688
  45. package/dist/utils.js.map +1 -1
  46. package/docs/assets/highlight.css +14 -0
  47. package/docs/assets/icons.js +1 -1
  48. package/docs/assets/icons.svg +1 -1
  49. package/docs/assets/main.js +2 -2
  50. package/docs/assets/style.css +3 -3
  51. package/docs/index.html +77 -13
  52. package/docs/variables/default.html +1 -1
  53. package/eslint.config.js +2 -8
  54. package/package.json +21 -28
  55. package/scripts/e2e/README.md +25 -0
  56. package/scripts/e2e/curtain-e2e.sh +70 -0
  57. package/scripts/e2e/fan-e2e.sh +75 -0
  58. package/scripts/e2e/light-advanced-e2e.sh +97 -0
  59. package/scripts/e2e/light-e2e.sh +75 -0
  60. package/scripts/e2e/list-accessories.sh +19 -0
  61. package/scripts/e2e/lock-e2e.sh +65 -0
  62. package/scripts/generate-matter-maps.js +60 -0
  63. package/scripts/run-e2e-local.sh +14 -0
  64. package/src/deviceFactory.ts +122 -0
  65. package/src/devices/deviceBase.ts +141 -0
  66. package/src/devices/genericDevice.ts +995 -0
  67. package/src/homebridge-ui/public/index.html +636 -246
  68. package/src/homebridge-ui/server.ts +552 -41
  69. package/src/index.ts +4 -7
  70. package/src/platform.ts +1561 -0
  71. package/src/settings.ts +12 -277
  72. package/src/switchbotClient.ts +203 -0
  73. package/src/utils.ts +45 -713
  74. package/test/accessory-restore.spec.ts +73 -0
  75. package/test/device-mapping.spec.ts +37 -0
  76. package/test/deviceFactory.spec.ts +18 -0
  77. package/test/e2e/run-e2e.spec.ts +50 -0
  78. package/test/fan-swing.spec.ts +29 -0
  79. package/test/helpers/matter-harness.ts +53 -0
  80. package/test/lock-users.spec.ts +44 -0
  81. package/test/matter-childbridge.spec.ts +55 -0
  82. package/test/matter-descriptors.spec.ts +97 -0
  83. package/test/matter-device-state.spec.ts +101 -0
  84. package/test/matter-integration.spec.ts +70 -0
  85. package/test/platform.integration.spec.ts +55 -0
  86. package/test/switchbot-client-debounce.spec.ts +131 -0
  87. package/test/switchbot-client-openapi.spec.ts +56 -0
  88. package/test/switchbotClient.spec.ts +10 -0
  89. package/test/utils.spec.ts +20 -0
  90. package/vitest.config.ts +7 -0
  91. package/coverage/base.css +0 -224
  92. package/coverage/block-navigation.js +0 -87
  93. package/coverage/clover.xml +0 -15847
  94. package/coverage/coverage-final.json +0 -42
  95. package/coverage/docs/assets/dmt/dmt-component-data.js.html +0 -85
  96. package/coverage/docs/assets/dmt/dmt-components.js.html +0 -286
  97. package/coverage/docs/assets/dmt/index.html +0 -131
  98. package/coverage/docs/assets/hierarchy.js.html +0 -85
  99. package/coverage/docs/assets/icons.js.html +0 -136
  100. package/coverage/docs/assets/index.html +0 -146
  101. package/coverage/docs/assets/main.js.html +0 -265
  102. package/coverage/favicon.png +0 -0
  103. package/coverage/index.html +0 -191
  104. package/coverage/prettify.css +0 -1
  105. package/coverage/prettify.js +0 -2
  106. package/coverage/sort-arrow-sprite.png +0 -0
  107. package/coverage/sorter.js +0 -196
  108. package/coverage/src/device/blindtilt.ts.html +0 -3238
  109. package/coverage/src/device/bot.ts.html +0 -2803
  110. package/coverage/src/device/ceilinglight.ts.html +0 -2338
  111. package/coverage/src/device/colorbulb.ts.html +0 -2824
  112. package/coverage/src/device/contact.ts.html +0 -1465
  113. package/coverage/src/device/curtain.ts.html +0 -2869
  114. package/coverage/src/device/device.ts.html +0 -2500
  115. package/coverage/src/device/fan.ts.html +0 -2242
  116. package/coverage/src/device/hub.ts.html +0 -1408
  117. package/coverage/src/device/humidifier.ts.html +0 -2116
  118. package/coverage/src/device/index.html +0 -416
  119. package/coverage/src/device/iosensor.ts.html +0 -1375
  120. package/coverage/src/device/lightstrip.ts.html +0 -2617
  121. package/coverage/src/device/lock.ts.html +0 -1963
  122. package/coverage/src/device/meter.ts.html +0 -1372
  123. package/coverage/src/device/meterplus.ts.html +0 -1384
  124. package/coverage/src/device/meterpro.ts.html +0 -1618
  125. package/coverage/src/device/motion.ts.html +0 -1264
  126. package/coverage/src/device/plug.ts.html +0 -1372
  127. package/coverage/src/device/relayswitch.ts.html +0 -2284
  128. package/coverage/src/device/robotvacuumcleaner.ts.html +0 -1810
  129. package/coverage/src/device/waterdetector.ts.html +0 -1294
  130. package/coverage/src/homebridge-ui/index.html +0 -116
  131. package/coverage/src/homebridge-ui/server.ts.html +0 -229
  132. package/coverage/src/index.html +0 -161
  133. package/coverage/src/index.ts.html +0 -124
  134. package/coverage/src/irdevice/airconditioner.ts.html +0 -1687
  135. package/coverage/src/irdevice/airpurifier.ts.html +0 -844
  136. package/coverage/src/irdevice/camera.ts.html +0 -475
  137. package/coverage/src/irdevice/fan.ts.html +0 -766
  138. package/coverage/src/irdevice/index.html +0 -251
  139. package/coverage/src/irdevice/irdevice.ts.html +0 -1117
  140. package/coverage/src/irdevice/light.ts.html +0 -826
  141. package/coverage/src/irdevice/other.ts.html +0 -2458
  142. package/coverage/src/irdevice/tv.ts.html +0 -1222
  143. package/coverage/src/irdevice/vacuumcleaner.ts.html +0 -466
  144. package/coverage/src/irdevice/waterheater.ts.html +0 -469
  145. package/coverage/src/platform.ts.html +0 -8776
  146. package/coverage/src/settings.ts.html +0 -934
  147. package/coverage/src/utils.ts.html +0 -2092
  148. package/dist/devices-hap/airpurifier.d.ts +0 -54
  149. package/dist/devices-hap/airpurifier.d.ts.map +0 -1
  150. package/dist/devices-hap/airpurifier.js +0 -527
  151. package/dist/devices-hap/airpurifier.js.map +0 -1
  152. package/dist/devices-hap/blindtilt.d.ts +0 -90
  153. package/dist/devices-hap/blindtilt.d.ts.map +0 -1
  154. package/dist/devices-hap/blindtilt.js +0 -974
  155. package/dist/devices-hap/blindtilt.js.map +0 -1
  156. package/dist/devices-hap/bot.d.ts +0 -102
  157. package/dist/devices-hap/bot.d.ts.map +0 -1
  158. package/dist/devices-hap/bot.js +0 -811
  159. package/dist/devices-hap/bot.js.map +0 -1
  160. package/dist/devices-hap/ceilinglight.d.ts +0 -85
  161. package/dist/devices-hap/ceilinglight.d.ts.map +0 -1
  162. package/dist/devices-hap/ceilinglight.js +0 -701
  163. package/dist/devices-hap/ceilinglight.js.map +0 -1
  164. package/dist/devices-hap/colorbulb.d.ts +0 -88
  165. package/dist/devices-hap/colorbulb.d.ts.map +0 -1
  166. package/dist/devices-hap/colorbulb.js +0 -881
  167. package/dist/devices-hap/colorbulb.js.map +0 -1
  168. package/dist/devices-hap/contact.d.ts +0 -44
  169. package/dist/devices-hap/contact.d.ts.map +0 -1
  170. package/dist/devices-hap/contact.js +0 -409
  171. package/dist/devices-hap/contact.js.map +0 -1
  172. package/dist/devices-hap/curtain.d.ts +0 -73
  173. package/dist/devices-hap/curtain.d.ts.map +0 -1
  174. package/dist/devices-hap/curtain.js +0 -869
  175. package/dist/devices-hap/curtain.js.map +0 -1
  176. package/dist/devices-hap/device.d.ts +0 -98
  177. package/dist/devices-hap/device.d.ts.map +0 -1
  178. package/dist/devices-hap/device.js +0 -749
  179. package/dist/devices-hap/device.js.map +0 -1
  180. package/dist/devices-hap/fan.d.ts +0 -69
  181. package/dist/devices-hap/fan.d.ts.map +0 -1
  182. package/dist/devices-hap/fan.js +0 -649
  183. package/dist/devices-hap/fan.js.map +0 -1
  184. package/dist/devices-hap/hub.d.ts +0 -37
  185. package/dist/devices-hap/hub.d.ts.map +0 -1
  186. package/dist/devices-hap/hub.js +0 -392
  187. package/dist/devices-hap/hub.js.map +0 -1
  188. package/dist/devices-hap/humidifier.d.ts +0 -68
  189. package/dist/devices-hap/humidifier.d.ts.map +0 -1
  190. package/dist/devices-hap/humidifier.js +0 -628
  191. package/dist/devices-hap/humidifier.js.map +0 -1
  192. package/dist/devices-hap/iosensor.d.ts +0 -42
  193. package/dist/devices-hap/iosensor.d.ts.map +0 -1
  194. package/dist/devices-hap/iosensor.js +0 -382
  195. package/dist/devices-hap/iosensor.js.map +0 -1
  196. package/dist/devices-hap/lightstrip.d.ts +0 -79
  197. package/dist/devices-hap/lightstrip.d.ts.map +0 -1
  198. package/dist/devices-hap/lightstrip.js +0 -797
  199. package/dist/devices-hap/lightstrip.js.map +0 -1
  200. package/dist/devices-hap/lock.d.ts +0 -53
  201. package/dist/devices-hap/lock.d.ts.map +0 -1
  202. package/dist/devices-hap/lock.js +0 -561
  203. package/dist/devices-hap/lock.js.map +0 -1
  204. package/dist/devices-hap/meter.d.ts +0 -37
  205. package/dist/devices-hap/meter.d.ts.map +0 -1
  206. package/dist/devices-hap/meter.js +0 -379
  207. package/dist/devices-hap/meter.js.map +0 -1
  208. package/dist/devices-hap/meterplus.d.ts +0 -42
  209. package/dist/devices-hap/meterplus.d.ts.map +0 -1
  210. package/dist/devices-hap/meterplus.js +0 -384
  211. package/dist/devices-hap/meterplus.js.map +0 -1
  212. package/dist/devices-hap/meterpro.d.ts +0 -43
  213. package/dist/devices-hap/meterpro.d.ts.map +0 -1
  214. package/dist/devices-hap/meterpro.js +0 -468
  215. package/dist/devices-hap/meterpro.js.map +0 -1
  216. package/dist/devices-hap/motion.d.ts +0 -42
  217. package/dist/devices-hap/motion.d.ts.map +0 -1
  218. package/dist/devices-hap/motion.js +0 -345
  219. package/dist/devices-hap/motion.js.map +0 -1
  220. package/dist/devices-hap/plug.d.ts +0 -49
  221. package/dist/devices-hap/plug.d.ts.map +0 -1
  222. package/dist/devices-hap/plug.js +0 -395
  223. package/dist/devices-hap/plug.js.map +0 -1
  224. package/dist/devices-hap/relayswitch.d.ts +0 -96
  225. package/dist/devices-hap/relayswitch.d.ts.map +0 -1
  226. package/dist/devices-hap/relayswitch.js +0 -642
  227. package/dist/devices-hap/relayswitch.js.map +0 -1
  228. package/dist/devices-hap/robotvacuumcleaner.d.ts +0 -54
  229. package/dist/devices-hap/robotvacuumcleaner.d.ts.map +0 -1
  230. package/dist/devices-hap/robotvacuumcleaner.js +0 -523
  231. package/dist/devices-hap/robotvacuumcleaner.js.map +0 -1
  232. package/dist/devices-hap/waterdetector.d.ts +0 -41
  233. package/dist/devices-hap/waterdetector.d.ts.map +0 -1
  234. package/dist/devices-hap/waterdetector.js +0 -356
  235. package/dist/devices-hap/waterdetector.js.map +0 -1
  236. package/dist/devices-matter/BaseMatterAccessory.d.ts +0 -63
  237. package/dist/devices-matter/BaseMatterAccessory.d.ts.map +0 -1
  238. package/dist/devices-matter/BaseMatterAccessory.js +0 -100
  239. package/dist/devices-matter/BaseMatterAccessory.js.map +0 -1
  240. package/dist/devices-matter/ColorLightAccessory.d.ts +0 -18
  241. package/dist/devices-matter/ColorLightAccessory.d.ts.map +0 -1
  242. package/dist/devices-matter/ColorLightAccessory.js +0 -96
  243. package/dist/devices-matter/ColorLightAccessory.js.map +0 -1
  244. package/dist/devices-matter/ColorTemperatureLightAccessory.d.ts +0 -16
  245. package/dist/devices-matter/ColorTemperatureLightAccessory.d.ts.map +0 -1
  246. package/dist/devices-matter/ColorTemperatureLightAccessory.js +0 -83
  247. package/dist/devices-matter/ColorTemperatureLightAccessory.js.map +0 -1
  248. package/dist/devices-matter/ContactSensorAccessory.d.ts +0 -10
  249. package/dist/devices-matter/ContactSensorAccessory.d.ts.map +0 -1
  250. package/dist/devices-matter/ContactSensorAccessory.js +0 -31
  251. package/dist/devices-matter/ContactSensorAccessory.js.map +0 -1
  252. package/dist/devices-matter/DimmableLightAccessory.d.ts +0 -56
  253. package/dist/devices-matter/DimmableLightAccessory.d.ts.map +0 -1
  254. package/dist/devices-matter/DimmableLightAccessory.js +0 -170
  255. package/dist/devices-matter/DimmableLightAccessory.js.map +0 -1
  256. package/dist/devices-matter/DoorLockAccessory.d.ts +0 -12
  257. package/dist/devices-matter/DoorLockAccessory.d.ts.map +0 -1
  258. package/dist/devices-matter/DoorLockAccessory.js +0 -47
  259. package/dist/devices-matter/DoorLockAccessory.js.map +0 -1
  260. package/dist/devices-matter/ExtendedColorLightAccessory.d.ts +0 -19
  261. package/dist/devices-matter/ExtendedColorLightAccessory.d.ts.map +0 -1
  262. package/dist/devices-matter/ExtendedColorLightAccessory.js +0 -108
  263. package/dist/devices-matter/ExtendedColorLightAccessory.js.map +0 -1
  264. package/dist/devices-matter/FanAccessory.d.ts +0 -14
  265. package/dist/devices-matter/FanAccessory.d.ts.map +0 -1
  266. package/dist/devices-matter/FanAccessory.js +0 -73
  267. package/dist/devices-matter/FanAccessory.js.map +0 -1
  268. package/dist/devices-matter/HumiditySensorAccessory.d.ts +0 -10
  269. package/dist/devices-matter/HumiditySensorAccessory.d.ts.map +0 -1
  270. package/dist/devices-matter/HumiditySensorAccessory.js +0 -33
  271. package/dist/devices-matter/HumiditySensorAccessory.js.map +0 -1
  272. package/dist/devices-matter/LeakSensorAccessory.d.ts +0 -10
  273. package/dist/devices-matter/LeakSensorAccessory.d.ts.map +0 -1
  274. package/dist/devices-matter/LeakSensorAccessory.js +0 -30
  275. package/dist/devices-matter/LeakSensorAccessory.js.map +0 -1
  276. package/dist/devices-matter/LightSensorAccessory.d.ts +0 -10
  277. package/dist/devices-matter/LightSensorAccessory.d.ts.map +0 -1
  278. package/dist/devices-matter/LightSensorAccessory.js +0 -33
  279. package/dist/devices-matter/LightSensorAccessory.js.map +0 -1
  280. package/dist/devices-matter/OccupancySensorAccessory.d.ts +0 -10
  281. package/dist/devices-matter/OccupancySensorAccessory.d.ts.map +0 -1
  282. package/dist/devices-matter/OccupancySensorAccessory.js +0 -43
  283. package/dist/devices-matter/OccupancySensorAccessory.js.map +0 -1
  284. package/dist/devices-matter/OnOffLightAccessory.d.ts +0 -36
  285. package/dist/devices-matter/OnOffLightAccessory.d.ts.map +0 -1
  286. package/dist/devices-matter/OnOffLightAccessory.js +0 -117
  287. package/dist/devices-matter/OnOffLightAccessory.js.map +0 -1
  288. package/dist/devices-matter/OnOffOutletAccessory.d.ts +0 -12
  289. package/dist/devices-matter/OnOffOutletAccessory.d.ts.map +0 -1
  290. package/dist/devices-matter/OnOffOutletAccessory.js +0 -43
  291. package/dist/devices-matter/OnOffOutletAccessory.js.map +0 -1
  292. package/dist/devices-matter/OnOffSwitchAccessory.d.ts +0 -12
  293. package/dist/devices-matter/OnOffSwitchAccessory.d.ts.map +0 -1
  294. package/dist/devices-matter/OnOffSwitchAccessory.js +0 -43
  295. package/dist/devices-matter/OnOffSwitchAccessory.js.map +0 -1
  296. package/dist/devices-matter/RoboticVacuumAccessory.d.ts +0 -66
  297. package/dist/devices-matter/RoboticVacuumAccessory.d.ts.map +0 -1
  298. package/dist/devices-matter/RoboticVacuumAccessory.js +0 -402
  299. package/dist/devices-matter/RoboticVacuumAccessory.js.map +0 -1
  300. package/dist/devices-matter/SmokeCOAlarmAccessory.d.ts +0 -11
  301. package/dist/devices-matter/SmokeCOAlarmAccessory.d.ts.map +0 -1
  302. package/dist/devices-matter/SmokeCOAlarmAccessory.js +0 -49
  303. package/dist/devices-matter/SmokeCOAlarmAccessory.js.map +0 -1
  304. package/dist/devices-matter/TemperatureSensorAccessory.d.ts +0 -10
  305. package/dist/devices-matter/TemperatureSensorAccessory.d.ts.map +0 -1
  306. package/dist/devices-matter/TemperatureSensorAccessory.js +0 -33
  307. package/dist/devices-matter/TemperatureSensorAccessory.js.map +0 -1
  308. package/dist/devices-matter/ThermostatAccessory.d.ts +0 -17
  309. package/dist/devices-matter/ThermostatAccessory.d.ts.map +0 -1
  310. package/dist/devices-matter/ThermostatAccessory.js +0 -87
  311. package/dist/devices-matter/ThermostatAccessory.js.map +0 -1
  312. package/dist/devices-matter/VenetianBlindAccessory.d.ts +0 -17
  313. package/dist/devices-matter/VenetianBlindAccessory.d.ts.map +0 -1
  314. package/dist/devices-matter/VenetianBlindAccessory.js +0 -100
  315. package/dist/devices-matter/VenetianBlindAccessory.js.map +0 -1
  316. package/dist/devices-matter/WindowBlindAccessory.d.ts +0 -15
  317. package/dist/devices-matter/WindowBlindAccessory.d.ts.map +0 -1
  318. package/dist/devices-matter/WindowBlindAccessory.js +0 -81
  319. package/dist/devices-matter/WindowBlindAccessory.js.map +0 -1
  320. package/dist/devices-matter/custom/PowerStripAccessory.d.ts +0 -97
  321. package/dist/devices-matter/custom/PowerStripAccessory.d.ts.map +0 -1
  322. package/dist/devices-matter/custom/PowerStripAccessory.js +0 -265
  323. package/dist/devices-matter/custom/PowerStripAccessory.js.map +0 -1
  324. package/dist/devices-matter/custom/index.d.ts +0 -8
  325. package/dist/devices-matter/custom/index.d.ts.map +0 -1
  326. package/dist/devices-matter/custom/index.js +0 -8
  327. package/dist/devices-matter/custom/index.js.map +0 -1
  328. package/dist/devices-matter/index.d.ts +0 -29
  329. package/dist/devices-matter/index.d.ts.map +0 -1
  330. package/dist/devices-matter/index.js +0 -28
  331. package/dist/devices-matter/index.js.map +0 -1
  332. package/dist/index.test.d.ts +0 -2
  333. package/dist/index.test.d.ts.map +0 -1
  334. package/dist/index.test.js +0 -14
  335. package/dist/index.test.js.map +0 -1
  336. package/dist/irdevice/airconditioner.d.ts +0 -61
  337. package/dist/irdevice/airconditioner.d.ts.map +0 -1
  338. package/dist/irdevice/airconditioner.js +0 -472
  339. package/dist/irdevice/airconditioner.js.map +0 -1
  340. package/dist/irdevice/airpurifier.d.ts +0 -50
  341. package/dist/irdevice/airpurifier.d.ts.map +0 -1
  342. package/dist/irdevice/airpurifier.js +0 -213
  343. package/dist/irdevice/airpurifier.js.map +0 -1
  344. package/dist/irdevice/camera.d.ts +0 -32
  345. package/dist/irdevice/camera.d.ts.map +0 -1
  346. package/dist/irdevice/camera.js +0 -107
  347. package/dist/irdevice/camera.js.map +0 -1
  348. package/dist/irdevice/fan.d.ts +0 -36
  349. package/dist/irdevice/fan.d.ts.map +0 -1
  350. package/dist/irdevice/fan.js +0 -200
  351. package/dist/irdevice/fan.js.map +0 -1
  352. package/dist/irdevice/irdevice.d.ts +0 -68
  353. package/dist/irdevice/irdevice.d.ts.map +0 -1
  354. package/dist/irdevice/irdevice.js +0 -298
  355. package/dist/irdevice/irdevice.js.map +0 -1
  356. package/dist/irdevice/light.d.ts +0 -36
  357. package/dist/irdevice/light.d.ts.map +0 -1
  358. package/dist/irdevice/light.js +0 -206
  359. package/dist/irdevice/light.js.map +0 -1
  360. package/dist/irdevice/other.d.ts +0 -57
  361. package/dist/irdevice/other.d.ts.map +0 -1
  362. package/dist/irdevice/other.js +0 -778
  363. package/dist/irdevice/other.js.map +0 -1
  364. package/dist/irdevice/tv.d.ts +0 -45
  365. package/dist/irdevice/tv.d.ts.map +0 -1
  366. package/dist/irdevice/tv.js +0 -327
  367. package/dist/irdevice/tv.js.map +0 -1
  368. package/dist/irdevice/vacuumcleaner.d.ts +0 -28
  369. package/dist/irdevice/vacuumcleaner.d.ts.map +0 -1
  370. package/dist/irdevice/vacuumcleaner.js +0 -104
  371. package/dist/irdevice/vacuumcleaner.js.map +0 -1
  372. package/dist/irdevice/waterheater.d.ts +0 -30
  373. package/dist/irdevice/waterheater.d.ts.map +0 -1
  374. package/dist/irdevice/waterheater.js +0 -105
  375. package/dist/irdevice/waterheater.js.map +0 -1
  376. package/dist/platform-hap.d.ts +0 -149
  377. package/dist/platform-hap.d.ts.map +0 -1
  378. package/dist/platform-hap.js +0 -2849
  379. package/dist/platform-hap.js.map +0 -1
  380. package/dist/platform-matter.d.ts +0 -75
  381. package/dist/platform-matter.d.ts.map +0 -1
  382. package/dist/platform-matter.js +0 -379
  383. package/dist/platform-matter.js.map +0 -1
  384. package/dist/verifyconfig.test.d.ts +0 -2
  385. package/dist/verifyconfig.test.d.ts.map +0 -1
  386. package/dist/verifyconfig.test.js +0 -167
  387. package/dist/verifyconfig.test.js.map +0 -1
  388. package/src/custom.d.ts +0 -7
  389. package/src/devices-hap/airpurifier.ts +0 -563
  390. package/src/devices-hap/blindtilt.ts +0 -1049
  391. package/src/devices-hap/bot.ts +0 -900
  392. package/src/devices-hap/ceilinglight.ts +0 -742
  393. package/src/devices-hap/colorbulb.ts +0 -904
  394. package/src/devices-hap/contact.ts +0 -457
  395. package/src/devices-hap/curtain.ts +0 -944
  396. package/src/devices-hap/device.ts +0 -811
  397. package/src/devices-hap/fan.ts +0 -711
  398. package/src/devices-hap/hub.ts +0 -439
  399. package/src/devices-hap/humidifier.ts +0 -669
  400. package/src/devices-hap/iosensor.ts +0 -427
  401. package/src/devices-hap/lightstrip.ts +0 -836
  402. package/src/devices-hap/lock.ts +0 -620
  403. package/src/devices-hap/meter.ts +0 -426
  404. package/src/devices-hap/meterplus.ts +0 -430
  405. package/src/devices-hap/meterpro.ts +0 -522
  406. package/src/devices-hap/motion.ts +0 -390
  407. package/src/devices-hap/plug.ts +0 -423
  408. package/src/devices-hap/relayswitch.ts +0 -727
  409. package/src/devices-hap/robotvacuumcleaner.ts +0 -568
  410. package/src/devices-hap/waterdetector.ts +0 -400
  411. package/src/devices-matter/BaseMatterAccessory.ts +0 -131
  412. package/src/devices-matter/ColorLightAccessory.ts +0 -113
  413. package/src/devices-matter/ColorTemperatureLightAccessory.ts +0 -98
  414. package/src/devices-matter/ContactSensorAccessory.ts +0 -37
  415. package/src/devices-matter/DimmableLightAccessory.ts +0 -196
  416. package/src/devices-matter/DoorLockAccessory.ts +0 -56
  417. package/src/devices-matter/ExtendedColorLightAccessory.ts +0 -127
  418. package/src/devices-matter/FanAccessory.ts +0 -87
  419. package/src/devices-matter/HumiditySensorAccessory.ts +0 -39
  420. package/src/devices-matter/LeakSensorAccessory.ts +0 -36
  421. package/src/devices-matter/LightSensorAccessory.ts +0 -39
  422. package/src/devices-matter/OccupancySensorAccessory.ts +0 -52
  423. package/src/devices-matter/OnOffLightAccessory.ts +0 -133
  424. package/src/devices-matter/OnOffOutletAccessory.ts +0 -52
  425. package/src/devices-matter/OnOffSwitchAccessory.ts +0 -52
  426. package/src/devices-matter/RoboticVacuumAccessory.ts +0 -484
  427. package/src/devices-matter/SmokeCOAlarmAccessory.ts +0 -59
  428. package/src/devices-matter/TemperatureSensorAccessory.ts +0 -39
  429. package/src/devices-matter/ThermostatAccessory.ts +0 -105
  430. package/src/devices-matter/VenetianBlindAccessory.ts +0 -118
  431. package/src/devices-matter/WindowBlindAccessory.ts +0 -94
  432. package/src/devices-matter/custom/PowerStripAccessory.ts +0 -309
  433. package/src/devices-matter/custom/index.ts +0 -8
  434. package/src/devices-matter/index.ts +0 -29
  435. package/src/index.test.ts +0 -19
  436. package/src/irdevice/airconditioner.ts +0 -533
  437. package/src/irdevice/airpurifier.ts +0 -252
  438. package/src/irdevice/camera.ts +0 -129
  439. package/src/irdevice/fan.ts +0 -226
  440. package/src/irdevice/irdevice.ts +0 -344
  441. package/src/irdevice/light.ts +0 -246
  442. package/src/irdevice/other.ts +0 -790
  443. package/src/irdevice/tv.ts +0 -378
  444. package/src/irdevice/vacuumcleaner.ts +0 -126
  445. package/src/irdevice/waterheater.ts +0 -127
  446. package/src/platform-hap.ts +0 -2986
  447. package/src/platform-matter.ts +0 -465
  448. package/src/verifyconfig.test.ts +0 -197
@@ -1,379 +0,0 @@
1
- import { ColorLightAccessory, ColorTemperatureLightAccessory, ContactSensorAccessory, DimmableLightAccessory, DoorLockAccessory, ExtendedColorLightAccessory, FanAccessory, HumiditySensorAccessory, LeakSensorAccessory, LightSensorAccessory, OccupancySensorAccessory, OnOffLightAccessory, OnOffOutletAccessory, OnOffSwitchAccessory, PowerStripAccessory, RoboticVacuumAccessory, SmokeCOAlarmAccessory, TemperatureSensorAccessory, ThermostatAccessory, VenetianBlindAccessory, WindowBlindAccessory, } from './devices-matter/index.js';
2
- import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js';
3
- import { cleanDeviceConfig } from './utils.js';
4
- /**
5
- * MatterPlatform
6
- * Demonstrates all available Matter device types in Homebridge
7
- *
8
- * Organized by official Matter Specification v1.4.1 categories
9
- */
10
- export class SwitchBotMatterPlatform {
11
- log;
12
- config;
13
- api;
14
- // Track restored HAP cached accessories (required for DynamicPlatformPlugin)
15
- // This is commented out here as this plugin does not have any HAP accessories
16
- // public readonly accessories: Map<string, PlatformAccessory> = new Map()
17
- // Track restored Matter cached accessories
18
- matterAccessories = new Map();
19
- constructor(log, config, api) {
20
- this.log = log;
21
- this.config = config;
22
- this.api = api;
23
- this.log.debug('Finished initializing platform:', this.config.name);
24
- // Normalize deviceConfig to remove UI-inserted defaults
25
- try {
26
- if (this.config.options) {
27
- const cleaned = cleanDeviceConfig(this.config.options.deviceConfig);
28
- if (cleaned) {
29
- ;
30
- this.config.options.deviceConfig = cleaned;
31
- }
32
- else {
33
- delete this.config.options.deviceConfig;
34
- }
35
- }
36
- }
37
- catch (e) {
38
- this.log.debug('Failed to clean deviceConfig: %s', e);
39
- }
40
- // Does the user have a version of Homebridge that is compatible with matter?
41
- if (!this.api.isMatterAvailable?.()) {
42
- this.log.warn('Matter is not available in this version of Homebridge. Please update Homebridge to use this plugin.');
43
- }
44
- // Check if the user has matter enabled, this means:
45
- // - If the plugin is running on the main bridge, then the user must have enabled matter in the Homebridge settings page in the UI
46
- // - If the plugin is running on a child bridge, then the user must have enabled matter on the plugin bridge settings section in the UI
47
- // In reality, only the below check is needed, but they are both included here for completeness
48
- // Remember to use a '?.' optional chaining operator in case the user is running an older version of Homebridge that does not have these APIs
49
- if (!this.api.isMatterEnabled?.()) {
50
- this.log.warn('Matter is not enabled in Homebridge. Please enable Matter in the Homebridge settings to use this plugin.');
51
- return;
52
- }
53
- // Register Matter accessories when Homebridge has finished launching
54
- this.api.on('didFinishLaunching', () => {
55
- this.log.debug('Executed didFinishLaunching callback');
56
- this.registerMatterAccessories();
57
- });
58
- }
59
- /**
60
- * Required for DynamicPlatformPlugin
61
- * Called when homebridge restores cached accessories from disk at startup
62
- */
63
- configureAccessory( /* accessory: PlatformAccessory */) {
64
- // Note this is not used for Matter accessories - use configureMatterAccessory instead
65
- // This plugin does not have any hap accessories, so here we can comment this out
66
- // this.accessories.set(accessory.UUID, accessory)
67
- }
68
- /**
69
- * Called when homebridge restores cached Matter accessories from disk at startup.
70
- *
71
- * This is where you can access the `accessory.context` object to retrieve
72
- * any custom data you stored when the accessory was originally registered.
73
- */
74
- configureMatterAccessory(accessory) {
75
- this.log.debug('Loading cached Matter accessory:', accessory.displayName);
76
- this.matterAccessories.set(accessory.uuid, accessory);
77
- }
78
- /**
79
- * Register all Matter accessories
80
- */
81
- async registerMatterAccessories() {
82
- this.log.info('═'.repeat(80));
83
- this.log.info('Homebridge Matter Plugin');
84
- this.log.info('═'.repeat(80));
85
- // Remove accessories that are disabled in config
86
- await this.removeDisabledAccessories();
87
- // Register devices by Matter specification sections
88
- await this.registerSection4Lighting();
89
- await this.registerSection5SmartPlugs();
90
- await this.registerSection6Switches();
91
- await this.registerSection7Sensors();
92
- await this.registerSection8Closure();
93
- await this.registerSection9HVAC();
94
- await this.registerSection12Robotic();
95
- await this.registerCustomDevices();
96
- this.log.info('═'.repeat(80));
97
- this.log.info('Finished registering Matter accessories');
98
- this.log.info('═'.repeat(80));
99
- }
100
- /**
101
- * Remove accessories that are disabled in config
102
- */
103
- async removeDisabledAccessories() {
104
- const configMap = [
105
- { enabled: this.config.enableOnOffLight, uuid: this.api.matter.uuid.generate('matter-onoff-light'), name: 'On/Off Light' },
106
- { enabled: this.config.enableDimmableLight, uuid: this.api.matter.uuid.generate('matter-dimmable-light'), name: 'Dimmable Light' },
107
- { enabled: this.config.enableColourTemperatureLight, uuid: this.api.matter.uuid.generate('matter-colour-temp-light'), name: 'Colour Temperature Light' },
108
- { enabled: this.config.enableColourLight, uuid: this.api.matter.uuid.generate('matter-colour-light'), name: 'Colour Light (HS)' },
109
- { enabled: this.config.enableExtendedColourLight, uuid: this.api.matter.uuid.generate('matter-extended-colour-light'), name: 'Extended Colour Light' },
110
- { enabled: this.config.enableOnOffOutlet, uuid: this.api.matter.uuid.generate('matter-onoff-outlet'), name: 'On/Off Outlet' },
111
- { enabled: this.config.enableOnOffSwitch, uuid: this.api.matter.uuid.generate('matter-onoff-switch'), name: 'On/Off Switch' },
112
- { enabled: this.config.enableTemperatureSensor, uuid: this.api.matter.uuid.generate('matter-temperature-sensor'), name: 'Temperature Sensor' },
113
- { enabled: this.config.enableHumiditySensor, uuid: this.api.matter.uuid.generate('matter-humidity-sensor'), name: 'Humidity Sensor' },
114
- { enabled: this.config.enableLightSensor, uuid: this.api.matter.uuid.generate('matter-light-sensor'), name: 'Light Sensor' },
115
- { enabled: this.config.enableOccupancySensor, uuid: this.api.matter.uuid.generate('matter-occupancy-sensor'), name: 'Occupancy Sensor' },
116
- { enabled: this.config.enableContactSensor, uuid: this.api.matter.uuid.generate('matter-contact-sensor'), name: 'Contact Sensor' },
117
- { enabled: this.config.enableLeakSensor, uuid: this.api.matter.uuid.generate('matter-leak-sensor'), name: 'Leak Sensor' },
118
- { enabled: this.config.enableSmokeSensor, uuid: this.api.matter.uuid.generate('matter-smoke-sensor'), name: 'Smoke Sensor' },
119
- { enabled: this.config.enableDoorLock, uuid: this.api.matter.uuid.generate('matter-door-lock'), name: 'Door Lock' },
120
- { enabled: this.config.enableWindowBlind, uuid: this.api.matter.uuid.generate('matter-window-blind'), name: 'Window Blind' },
121
- { enabled: this.config.enableVenetianBlind, uuid: this.api.matter.uuid.generate('matter-venetian-blind'), name: 'Venetian Blind' },
122
- { enabled: this.config.enableThermostat, uuid: this.api.matter.uuid.generate('matter-thermostat'), name: 'Thermostat' },
123
- { enabled: this.config.enableFan, uuid: this.api.matter.uuid.generate('matter-fan'), name: 'Fan' },
124
- { enabled: this.config.enableRobotVacuum, uuid: this.api.matter.uuid.generate('matter-robot-vacuum'), name: 'Robot Vacuum' },
125
- { enabled: this.config.enablePowerStrip, uuid: this.api.matter.uuid.generate('matter-power-strip'), name: 'Power Strip' },
126
- ];
127
- for (const { enabled, uuid, name } of configMap) {
128
- if (enabled === false) {
129
- const existingAccessory = this.matterAccessories.get(uuid);
130
- if (existingAccessory) {
131
- this.log.info(`Removing accessory '${name}' (disabled in config)`);
132
- await this.api.matter.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [existingAccessory]);
133
- this.matterAccessories.delete(uuid);
134
- }
135
- }
136
- }
137
- }
138
- /**
139
- * Section 4: Lighting Devices (Matter Spec § 4)
140
- */
141
- async registerSection4Lighting() {
142
- this.log.info('═'.repeat(80));
143
- this.log.info('Section 4: Lighting Devices (Matter Spec § 4)');
144
- this.log.info('═'.repeat(80));
145
- const accessories = [];
146
- // On/Off Light
147
- if (this.config.enableOnOffLight !== false) {
148
- const device = new OnOffLightAccessory(this.api, this.log);
149
- accessories.push(device.toAccessory());
150
- }
151
- // Dimmable Light
152
- if (this.config.enableDimmableLight !== false) {
153
- const device = new DimmableLightAccessory(this.api, this.log);
154
- accessories.push(device.toAccessory());
155
- }
156
- // Color Temperature Light
157
- if (this.config.enableColourTemperatureLight !== false) {
158
- const device = new ColorTemperatureLightAccessory(this.api, this.log);
159
- accessories.push(device.toAccessory());
160
- }
161
- // Color Light (HS only)
162
- if (this.config.enableColourLight !== false) {
163
- const device = new ColorLightAccessory(this.api, this.log);
164
- accessories.push(device.toAccessory());
165
- }
166
- // Extended Color Light (HS+CCT)
167
- if (this.config.enableExtendedColourLight !== false) {
168
- const device = new ExtendedColorLightAccessory(this.api, this.log);
169
- accessories.push(device.toAccessory());
170
- }
171
- if (accessories.length > 0) {
172
- this.log.info(`✓ Registered ${accessories.length} lighting device(s)`);
173
- for (const acc of accessories) {
174
- this.log.info(` - ${acc.displayName}`);
175
- }
176
- await this.api.matter.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, accessories);
177
- }
178
- }
179
- /**
180
- * Section 5: Smart Plugs/Actuators (Matter Spec § 5)
181
- */
182
- async registerSection5SmartPlugs() {
183
- this.log.info('═'.repeat(80));
184
- this.log.info('Section 5: Smart Plugs/Actuators (Matter Spec § 5)');
185
- this.log.info('═'.repeat(80));
186
- const accessories = [];
187
- // On/Off Outlet
188
- if (this.config.enableOnOffOutlet !== false) {
189
- const device = new OnOffOutletAccessory(this.api, this.log);
190
- accessories.push(device.toAccessory());
191
- }
192
- if (accessories.length > 0) {
193
- this.log.info(`✓ Registered ${accessories.length} smart plug/actuator device(s)`);
194
- for (const acc of accessories) {
195
- this.log.info(` - ${acc.displayName}`);
196
- }
197
- await this.api.matter.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, accessories);
198
- }
199
- }
200
- /**
201
- * Section 6: Switches & Controllers (Matter Spec § 6)
202
- */
203
- async registerSection6Switches() {
204
- this.log.info('═'.repeat(80));
205
- this.log.info('Section 6: Switches & Controllers (Matter Spec § 6)');
206
- this.log.info('═'.repeat(80));
207
- const accessories = [];
208
- // On/Off Switch
209
- if (this.config.enableOnOffSwitch !== false) {
210
- const device = new OnOffSwitchAccessory(this.api, this.log);
211
- accessories.push(device.toAccessory());
212
- }
213
- if (accessories.length > 0) {
214
- this.log.info(`✓ Registered ${accessories.length} switch/controller device(s)`);
215
- for (const acc of accessories) {
216
- this.log.info(` - ${acc.displayName}`);
217
- }
218
- await this.api.matter.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, accessories);
219
- }
220
- }
221
- /**
222
- * Section 7: Sensors (Matter Spec § 7)
223
- */
224
- async registerSection7Sensors() {
225
- this.log.info('═'.repeat(80));
226
- this.log.info('Section 7: Sensors (Matter Spec § 7)');
227
- this.log.info('═'.repeat(80));
228
- const accessories = [];
229
- // Contact Sensor
230
- if (this.config.enableContactSensor !== false) {
231
- const device = new ContactSensorAccessory(this.api, this.log);
232
- accessories.push(device.toAccessory());
233
- }
234
- // Light Sensor
235
- if (this.config.enableLightSensor !== false) {
236
- const device = new LightSensorAccessory(this.api, this.log);
237
- accessories.push(device.toAccessory());
238
- }
239
- // Occupancy Sensor
240
- if (this.config.enableOccupancySensor !== false) {
241
- const device = new OccupancySensorAccessory(this.api, this.log);
242
- accessories.push(device.toAccessory());
243
- }
244
- // Temperature Sensor
245
- if (this.config.enableTemperatureSensor !== false) {
246
- const device = new TemperatureSensorAccessory(this.api, this.log);
247
- accessories.push(device.toAccessory());
248
- }
249
- // Humidity Sensor
250
- if (this.config.enableHumiditySensor !== false) {
251
- const device = new HumiditySensorAccessory(this.api, this.log);
252
- accessories.push(device.toAccessory());
253
- }
254
- // Smoke/CO Alarm
255
- if (this.config.enableSmokeSensor !== false) {
256
- const device = new SmokeCOAlarmAccessory(this.api, this.log);
257
- accessories.push(device.toAccessory());
258
- }
259
- // Leak Sensor
260
- if (this.config.enableLeakSensor !== false) {
261
- const device = new LeakSensorAccessory(this.api, this.log);
262
- accessories.push(device.toAccessory());
263
- }
264
- if (accessories.length > 0) {
265
- this.log.info(`✓ Registered ${accessories.length} sensor device(s)`);
266
- for (const acc of accessories) {
267
- this.log.info(` - ${acc.displayName}`);
268
- }
269
- await this.api.matter.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, accessories);
270
- }
271
- }
272
- /**
273
- * Section 8: Closure Devices (Matter Spec § 8)
274
- */
275
- async registerSection8Closure() {
276
- this.log.info('═'.repeat(80));
277
- this.log.info('Section 8: Closure Devices (Matter Spec § 8)');
278
- this.log.info('═'.repeat(80));
279
- const accessories = [];
280
- // Door Lock
281
- if (this.config.enableDoorLock !== false) {
282
- const device = new DoorLockAccessory(this.api, this.log);
283
- accessories.push(device.toAccessory());
284
- }
285
- // Window Blind
286
- if (this.config.enableWindowBlind !== false) {
287
- const device = new WindowBlindAccessory(this.api, this.log);
288
- accessories.push(device.toAccessory());
289
- }
290
- // Venetian Blind
291
- if (this.config.enableVenetianBlind !== false) {
292
- const device = new VenetianBlindAccessory(this.api, this.log);
293
- accessories.push(device.toAccessory());
294
- }
295
- if (accessories.length > 0) {
296
- this.log.info(`✓ Registered ${accessories.length} closure device(s)`);
297
- for (const acc of accessories) {
298
- this.log.info(` - ${acc.displayName}`);
299
- }
300
- await this.api.matter.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, accessories);
301
- }
302
- }
303
- /**
304
- * Section 9: HVAC (Matter Spec § 9)
305
- */
306
- async registerSection9HVAC() {
307
- this.log.info('═'.repeat(80));
308
- this.log.info('Section 9: HVAC (Matter Spec § 9)');
309
- this.log.info('═'.repeat(80));
310
- const accessories = [];
311
- // Thermostat
312
- if (this.config.enableThermostat !== false) {
313
- const device = new ThermostatAccessory(this.api, this.log);
314
- accessories.push(device.toAccessory());
315
- }
316
- // Fan
317
- if (this.config.enableFan !== false) {
318
- const device = new FanAccessory(this.api, this.log);
319
- accessories.push(device.toAccessory());
320
- }
321
- if (accessories.length > 0) {
322
- this.log.info(`✓ Registered ${accessories.length} HVAC device(s)`);
323
- for (const acc of accessories) {
324
- this.log.info(` - ${acc.displayName}`);
325
- }
326
- await this.api.matter.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, accessories);
327
- }
328
- }
329
- /**
330
- * Section 12: Robotic Devices (Matter Spec § 12)
331
- * ⚠️ IMPORTANT: RVC devices use a DIFFERENT PROCESS (same code) than other devices!
332
- * When this runs, you'll see separate commissioning codes in the logs for the robot vacuum.
333
- * Use those codes to pair the vacuum as a separate bridge in your Home app.
334
- */
335
- async registerSection12Robotic() {
336
- this.log.info('═'.repeat(80));
337
- this.log.info('Section 12: Robotic Devices (Matter Spec § 12)');
338
- this.log.info('═'.repeat(80));
339
- const accessories = [];
340
- // Robot Vacuum
341
- if (this.config.enableRobotVacuum !== false) {
342
- const device = new RoboticVacuumAccessory(this.api, this.log);
343
- accessories.push(device.toAccessory());
344
- }
345
- if (accessories.length > 0) {
346
- this.log.info(`✓ Registered ${accessories.length} robot vacuum device(s)`);
347
- for (const acc of accessories) {
348
- this.log.info(` - ${acc.displayName} (standalone for Apple Home compatibility)`);
349
- }
350
- await this.api.matter.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, accessories);
351
- }
352
- }
353
- /**
354
- * Custom Devices
355
- *
356
- * This section demonstrates custom device implementations that go beyond
357
- * the standard Matter device types. These examples show advanced patterns
358
- * like managing multiple logical components within a single device.
359
- */
360
- async registerCustomDevices() {
361
- this.log.info('═'.repeat(80));
362
- this.log.info('Custom Devices');
363
- this.log.info('═'.repeat(80));
364
- const accessories = [];
365
- // Power Strip (4 Outlets)
366
- if (this.config.enablePowerStrip !== false) {
367
- const device = new PowerStripAccessory(this.api, this.log);
368
- accessories.push(device.toAccessory());
369
- }
370
- if (accessories.length > 0) {
371
- this.log.info(`✓ Registered ${accessories.length} custom device(s)`);
372
- for (const acc of accessories) {
373
- this.log.info(` - ${acc.displayName}`);
374
- }
375
- await this.api.matter.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, accessories);
376
- }
377
- }
378
- }
379
- //# sourceMappingURL=platform-matter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-matter.js","sourceRoot":"","sources":["../src/platform-matter.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,2BAA2B,EAC3B,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAShB;IACA;IACA;IAVlB,6EAA6E;IAC7E,8EAA8E;IAC9E,0EAA0E;IAE1E,2CAA2C;IAC3B,iBAAiB,GAA2C,IAAI,GAAG,EAAE,CAAA;IAErF,YACkB,GAAY,EACZ,MAA+B,EAC/B,GAAQ;QAFR,QAAG,GAAH,GAAG,CAAS;QACZ,WAAM,GAAN,MAAM,CAAyB;QAC/B,QAAG,GAAH,GAAG,CAAK;QAExB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iCAAiC,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAEnE,wDAAwD;QACxD,IAAI,CAAC;YACH,IAAK,IAA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C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;QAC7B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAC/B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;QAE7B,MAAM,WAAW,GAAoD,EAAE,CAAA;QAEvE,0BAA0B;QAC1B,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB,KAAK,KAAK,EAAE,CAAC;YAC3C,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;YAC1D,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;QACxC,CAAC;QAED,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,WAAW,CAAC,MAAM,mBAAmB,CAAC,CAAA;YACpE,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;gBAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,CAAA;YACzC,CAAC;YACD,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,2BAA2B,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAA;QAC5F,CAAC;IACH,CAAC;CACF"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=verifyconfig.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verifyconfig.test.d.ts","sourceRoot":"","sources":["../src/verifyconfig.test.ts"],"names":[],"mappings":""}
@@ -1,167 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- // Create a minimal mock of the SwitchBotPlatform to test verifyConfig
3
- class MockSwitchBotPlatform {
4
- config;
5
- errorLogCalls = [];
6
- debugLogCalls = [];
7
- constructor(config) {
8
- this.config = config;
9
- }
10
- errorLog(message) {
11
- this.errorLogCalls.push(message);
12
- }
13
- debugLog(message) {
14
- this.debugLogCalls.push(message);
15
- }
16
- debugWarnLog(message) {
17
- this.debugLogCalls.push(`WARN: ${message}`);
18
- }
19
- debugErrorLog(message) {
20
- this.debugLogCalls.push(`ERROR: ${message}`);
21
- }
22
- // Copy the exact verifyConfig method from the actual platform
23
- async verifyConfig() {
24
- this.debugLog('Verifying Config');
25
- this.config = this.config || {};
26
- this.config.options = this.config.options || {};
27
- if (this.config.options) {
28
- // Device Config
29
- if (this.config.options.devices) {
30
- for (const deviceConfig of this.config.options.devices) {
31
- if (!deviceConfig.hide_device) {
32
- if (!deviceConfig.deviceId) {
33
- this.errorLog('The devices config section is missing the *Device ID* in the config. Please check your config.');
34
- }
35
- if (!deviceConfig.configDeviceType && deviceConfig.connectionType) {
36
- this.errorLog('The devices config section is missing the *Device Type* in the config. Please check your config.');
37
- }
38
- }
39
- }
40
- }
41
- // IR Device Config
42
- if (this.config.options.irdevices) {
43
- for (const irDeviceConfig of this.config.options.irdevices) {
44
- if (!irDeviceConfig.hide_device) {
45
- if (!irDeviceConfig.deviceId) {
46
- this.errorLog('The devices config section is missing the *Device ID* in the config. Please check your config.');
47
- }
48
- if (!irDeviceConfig.deviceId && !irDeviceConfig.configRemoteType) {
49
- this.errorLog('The devices config section is missing the *Device Type* in the config. Please check your config.');
50
- }
51
- }
52
- }
53
- }
54
- }
55
- if (!this.config.credentials && !this.config.options) {
56
- this.debugWarnLog('Missing Credentials');
57
- }
58
- else if (this.config.credentials && !this.config.credentials.notice) {
59
- if (!this.config.credentials?.token) {
60
- this.debugErrorLog('Missing token');
61
- this.debugWarnLog('Cloud Enabled SwitchBot Devices & IR Devices will not work');
62
- }
63
- if (this.config.credentials?.token) {
64
- if (!this.config.credentials?.secret) {
65
- this.debugErrorLog('Missing secret');
66
- this.debugWarnLog('Cloud Enabled SwitchBot Devices & IR Devices will not work');
67
- }
68
- }
69
- }
70
- }
71
- }
72
- describe('verifyConfig fix for reboot loop', () => {
73
- it('should log error instead of throwing when device config is missing deviceId', async () => {
74
- const config = {
75
- platform: 'SwitchBot',
76
- name: 'SwitchBot',
77
- credentials: {
78
- token: 'test-token',
79
- secret: 'test-secret',
80
- },
81
- options: {
82
- devices: [
83
- {
84
- logging: 'standard',
85
- },
86
- ],
87
- },
88
- };
89
- const platform = new MockSwitchBotPlatform(config);
90
- // This should NOT throw an error anymore - it should log instead
91
- await expect(platform.verifyConfig()).resolves.not.toThrow();
92
- // Verify that the error was logged instead of thrown
93
- expect(platform.errorLogCalls).toContain('The devices config section is missing the *Device ID* in the config. Please check your config.');
94
- });
95
- it('should log error instead of throwing when device config is missing configDeviceType with connectionType', async () => {
96
- const config = {
97
- platform: 'SwitchBot',
98
- name: 'SwitchBot',
99
- credentials: {
100
- token: 'test-token',
101
- secret: 'test-secret',
102
- },
103
- options: {
104
- devices: [
105
- {
106
- deviceId: 'test-device-id',
107
- connectionType: 'BLE',
108
- // Missing configDeviceType
109
- },
110
- ],
111
- },
112
- };
113
- const platform = new MockSwitchBotPlatform(config);
114
- // This should NOT throw an error anymore - it should log instead
115
- await expect(platform.verifyConfig()).resolves.not.toThrow();
116
- // Verify that the error was logged instead of thrown
117
- expect(platform.errorLogCalls).toContain('The devices config section is missing the *Device Type* in the config. Please check your config.');
118
- });
119
- it('should not log error when device config has hide_device set to true', async () => {
120
- const config = {
121
- platform: 'SwitchBot',
122
- name: 'SwitchBot',
123
- credentials: {
124
- token: 'test-token',
125
- secret: 'test-secret',
126
- },
127
- options: {
128
- devices: [
129
- {
130
- hide_device: true,
131
- // Missing deviceId but hidden
132
- },
133
- ],
134
- },
135
- };
136
- const platform = new MockSwitchBotPlatform(config);
137
- // Should not throw or log errors because device is hidden
138
- await expect(platform.verifyConfig()).resolves.not.toThrow();
139
- expect(platform.errorLogCalls).toHaveLength(0);
140
- });
141
- it('should handle valid device config without errors', async () => {
142
- const config = {
143
- platform: 'SwitchBot',
144
- name: 'SwitchBot',
145
- credentials: {
146
- token: 'test-token',
147
- secret: 'test-secret',
148
- },
149
- options: {
150
- devices: [
151
- {
152
- deviceId: 'test-device-id',
153
- configDeviceType: 'Bot',
154
- logging: 'standard',
155
- },
156
- ],
157
- },
158
- };
159
- const platform = new MockSwitchBotPlatform(config);
160
- // Should not throw or log device config errors with valid config
161
- await expect(platform.verifyConfig()).resolves.not.toThrow();
162
- // Should not have device config errors
163
- expect(platform.errorLogCalls.filter(msg => msg.includes('missing the *Device ID*') ||
164
- msg.includes('missing the *Device Type*'))).toHaveLength(0);
165
- });
166
- });
167
- //# sourceMappingURL=verifyconfig.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verifyconfig.test.js","sourceRoot":"","sources":["../src/verifyconfig.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAM,MAAM,QAAQ,CAAA;AAGjD,sEAAsE;AACtE,MAAM,qBAAqB;IACzB,MAAM,CAAyB;IAC/B,aAAa,GAAa,EAAE,CAAA;IAC5B,aAAa,GAAa,EAAE,CAAA;IAE5B,YAAY,MAA+B;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,QAAQ,CAAC,OAAe;QACtB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAClC,CAAC;IAED,QAAQ,CAAC,OAAe;QACtB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAClC,CAAC;IAED,YAAY,CAAC,OAAe;QAC1B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,OAAO,EAAE,CAAC,CAAA;IAC7C,CAAC;IAED,aAAa,CAAC,OAAe;QAC3B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,OAAO,EAAE,CAAC,CAAA;IAC9C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M,QAAQ,GAAG,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAA;QAElD,0DAA0D;QAC1D,MAAM,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;QAC5D,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;IAChD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAChE,MAAM,MAAM,GAA4B;YACtC,QAAQ,EAAE,WAAW;YACrB,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE;gBACX,KAAK,EAAE,YAAY;gBACnB,MAAM,EAAE,aAAa;aACtB;YACD,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP;wBACE,QAAQ,EAAE,gBAAgB;wBAC1B,gBAAgB,EAAE,KAAK;wBACvB,OAAO,EAAE,UAAU;qBACb;iBACT;aACF;SACF,CAAA;QAED,MAAM,QAAQ,GAAG,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAA;QAElD,iEAAiE;QACjE,MAAM,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;QAE5D,uCAAuC;QACvC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CACzC,GAAG,CAAC,QAAQ,CAAC,yBAAyB,CAAC;YACvC,GAAG,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAC1C,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;IACpB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/src/custom.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /* Copyright(C) 2017-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
2
- *
3
- * custom.d.ts: @switchbot/homebridge-switchbot platform class.
4
- */
5
- declare module 'homebridge-lib'
6
- declare module 'homebridge-lib/EveHomeKitTypes'
7
- declare module 'fakegato-history'