homebridge 2.0.0-beta.44 → 2.0.0-beta.46

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 (321) hide show
  1. package/dist/api.d.ts +3 -365
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js +13 -85
  4. package/dist/api.js.map +1 -1
  5. package/dist/bridgeService.d.ts +0 -25
  6. package/dist/bridgeService.d.ts.map +1 -1
  7. package/dist/bridgeService.js +32 -85
  8. package/dist/bridgeService.js.map +1 -1
  9. package/dist/childBridgeFork.d.ts +12 -15
  10. package/dist/childBridgeFork.d.ts.map +1 -1
  11. package/dist/childBridgeFork.js +152 -83
  12. package/dist/childBridgeFork.js.map +1 -1
  13. package/dist/childBridgeService.d.ts +21 -105
  14. package/dist/childBridgeService.d.ts.map +1 -1
  15. package/dist/childBridgeService.js +57 -134
  16. package/dist/childBridgeService.js.map +1 -1
  17. package/dist/cli.js +0 -2
  18. package/dist/cli.js.map +1 -1
  19. package/dist/externalPortService.d.ts +0 -21
  20. package/dist/externalPortService.d.ts.map +1 -1
  21. package/dist/externalPortService.js +0 -28
  22. package/dist/externalPortService.js.map +1 -1
  23. package/dist/index.d.ts +0 -112
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +0 -44
  26. package/dist/index.js.map +1 -1
  27. package/dist/ipcService.d.ts +23 -15
  28. package/dist/ipcService.d.ts.map +1 -1
  29. package/dist/ipcService.js +6 -12
  30. package/dist/ipcService.js.map +1 -1
  31. package/dist/logger.d.ts +0 -46
  32. package/dist/logger.d.ts.map +1 -1
  33. package/dist/logger.js +13 -57
  34. package/dist/logger.js.map +1 -1
  35. package/dist/matter/BaseMatterManager.d.ts +19 -0
  36. package/dist/matter/BaseMatterManager.d.ts.map +1 -0
  37. package/dist/matter/BaseMatterManager.js +170 -0
  38. package/dist/matter/BaseMatterManager.js.map +1 -0
  39. package/dist/matter/ChildBridgeMatterManager.d.ts +7 -69
  40. package/dist/matter/ChildBridgeMatterManager.d.ts.map +1 -1
  41. package/dist/matter/ChildBridgeMatterManager.js +51 -234
  42. package/dist/matter/ChildBridgeMatterManager.js.map +1 -1
  43. package/dist/matter/ClusterCommandMapper.d.ts +5 -0
  44. package/dist/matter/ClusterCommandMapper.d.ts.map +1 -0
  45. package/dist/matter/ClusterCommandMapper.js +203 -0
  46. package/dist/matter/ClusterCommandMapper.js.map +1 -0
  47. package/dist/matter/ExternalMatterAccessoryPublisher.d.ts +0 -27
  48. package/dist/matter/ExternalMatterAccessoryPublisher.d.ts.map +1 -1
  49. package/dist/matter/ExternalMatterAccessoryPublisher.js +3 -28
  50. package/dist/matter/ExternalMatterAccessoryPublisher.js.map +1 -1
  51. package/dist/matter/MatterAPIImpl.d.ts +0 -68
  52. package/dist/matter/MatterAPIImpl.d.ts.map +1 -1
  53. package/dist/matter/MatterAPIImpl.js +7 -107
  54. package/dist/matter/MatterAPIImpl.js.map +1 -1
  55. package/dist/matter/MatterBridgeManager.d.ts +9 -60
  56. package/dist/matter/MatterBridgeManager.d.ts.map +1 -1
  57. package/dist/matter/MatterBridgeManager.js +140 -216
  58. package/dist/matter/MatterBridgeManager.js.map +1 -1
  59. package/dist/matter/MatterConfigCollector.d.ts +1 -20
  60. package/dist/matter/MatterConfigCollector.d.ts.map +1 -1
  61. package/dist/matter/MatterConfigCollector.js +15 -28
  62. package/dist/matter/MatterConfigCollector.js.map +1 -1
  63. package/dist/matter/accessoryCache.d.ts +0 -48
  64. package/dist/matter/accessoryCache.d.ts.map +1 -1
  65. package/dist/matter/accessoryCache.js +1 -60
  66. package/dist/matter/accessoryCache.js.map +1 -1
  67. package/dist/matter/behaviors/AirQualityBehavior.d.ts +0 -42
  68. package/dist/matter/behaviors/AirQualityBehavior.d.ts.map +1 -1
  69. package/dist/matter/behaviors/AirQualityBehavior.js +0 -44
  70. package/dist/matter/behaviors/AirQualityBehavior.js.map +1 -1
  71. package/dist/matter/behaviors/BehaviorRegistry.d.ts +4 -42
  72. package/dist/matter/behaviors/BehaviorRegistry.d.ts.map +1 -1
  73. package/dist/matter/behaviors/BehaviorRegistry.js +12 -42
  74. package/dist/matter/behaviors/BehaviorRegistry.js.map +1 -1
  75. package/dist/matter/behaviors/ColorControlBehavior.d.ts +0 -49
  76. package/dist/matter/behaviors/ColorControlBehavior.d.ts.map +1 -1
  77. package/dist/matter/behaviors/ColorControlBehavior.js +0 -90
  78. package/dist/matter/behaviors/ColorControlBehavior.js.map +1 -1
  79. package/dist/matter/behaviors/ConcentrationMeasurementBehavior.d.ts +0 -91
  80. package/dist/matter/behaviors/ConcentrationMeasurementBehavior.d.ts.map +1 -1
  81. package/dist/matter/behaviors/ConcentrationMeasurementBehavior.js +0 -96
  82. package/dist/matter/behaviors/ConcentrationMeasurementBehavior.js.map +1 -1
  83. package/dist/matter/behaviors/DoorLockBehavior.d.ts +0 -11
  84. package/dist/matter/behaviors/DoorLockBehavior.d.ts.map +1 -1
  85. package/dist/matter/behaviors/DoorLockBehavior.js +0 -25
  86. package/dist/matter/behaviors/DoorLockBehavior.js.map +1 -1
  87. package/dist/matter/behaviors/FanControlBehavior.d.ts +0 -11
  88. package/dist/matter/behaviors/FanControlBehavior.d.ts.map +1 -1
  89. package/dist/matter/behaviors/FanControlBehavior.js +0 -25
  90. package/dist/matter/behaviors/FanControlBehavior.js.map +1 -1
  91. package/dist/matter/behaviors/IdentifyBehavior.d.ts +0 -11
  92. package/dist/matter/behaviors/IdentifyBehavior.d.ts.map +1 -1
  93. package/dist/matter/behaviors/IdentifyBehavior.js +0 -17
  94. package/dist/matter/behaviors/IdentifyBehavior.js.map +1 -1
  95. package/dist/matter/behaviors/LevelControlBehavior.d.ts +0 -20
  96. package/dist/matter/behaviors/LevelControlBehavior.d.ts.map +1 -1
  97. package/dist/matter/behaviors/LevelControlBehavior.js +0 -52
  98. package/dist/matter/behaviors/LevelControlBehavior.js.map +1 -1
  99. package/dist/matter/behaviors/OnOffBehavior.d.ts +0 -17
  100. package/dist/matter/behaviors/OnOffBehavior.d.ts.map +1 -1
  101. package/dist/matter/behaviors/OnOffBehavior.js +0 -38
  102. package/dist/matter/behaviors/OnOffBehavior.js.map +1 -1
  103. package/dist/matter/behaviors/RvcCleanModeBehavior.d.ts +0 -11
  104. package/dist/matter/behaviors/RvcCleanModeBehavior.d.ts.map +1 -1
  105. package/dist/matter/behaviors/RvcCleanModeBehavior.js +0 -17
  106. package/dist/matter/behaviors/RvcCleanModeBehavior.js.map +1 -1
  107. package/dist/matter/behaviors/RvcOperationalStateBehavior.d.ts +0 -11
  108. package/dist/matter/behaviors/RvcOperationalStateBehavior.d.ts.map +1 -1
  109. package/dist/matter/behaviors/RvcOperationalStateBehavior.js +0 -29
  110. package/dist/matter/behaviors/RvcOperationalStateBehavior.js.map +1 -1
  111. package/dist/matter/behaviors/RvcRunModeBehavior.d.ts +0 -11
  112. package/dist/matter/behaviors/RvcRunModeBehavior.d.ts.map +1 -1
  113. package/dist/matter/behaviors/RvcRunModeBehavior.js +0 -17
  114. package/dist/matter/behaviors/RvcRunModeBehavior.js.map +1 -1
  115. package/dist/matter/behaviors/ServiceAreaBehavior.d.ts +0 -11
  116. package/dist/matter/behaviors/ServiceAreaBehavior.d.ts.map +1 -1
  117. package/dist/matter/behaviors/ServiceAreaBehavior.js +0 -23
  118. package/dist/matter/behaviors/ServiceAreaBehavior.js.map +1 -1
  119. package/dist/matter/behaviors/ThermostatBehavior.d.ts +0 -11
  120. package/dist/matter/behaviors/ThermostatBehavior.d.ts.map +1 -1
  121. package/dist/matter/behaviors/ThermostatBehavior.js +0 -39
  122. package/dist/matter/behaviors/ThermostatBehavior.js.map +1 -1
  123. package/dist/matter/behaviors/WindowCoveringBehavior.d.ts +0 -17
  124. package/dist/matter/behaviors/WindowCoveringBehavior.d.ts.map +1 -1
  125. package/dist/matter/behaviors/WindowCoveringBehavior.js +0 -56
  126. package/dist/matter/behaviors/WindowCoveringBehavior.js.map +1 -1
  127. package/dist/matter/behaviors/index.d.ts +0 -5
  128. package/dist/matter/behaviors/index.d.ts.map +1 -1
  129. package/dist/matter/behaviors/index.js +0 -5
  130. package/dist/matter/behaviors/index.js.map +1 -1
  131. package/dist/matter/configValidator.d.ts +0 -55
  132. package/dist/matter/configValidator.d.ts.map +1 -1
  133. package/dist/matter/configValidator.js +1 -68
  134. package/dist/matter/configValidator.js.map +1 -1
  135. package/dist/matter/errorHandler.d.ts +0 -22
  136. package/dist/matter/errorHandler.d.ts.map +1 -1
  137. package/dist/matter/errorHandler.js +0 -32
  138. package/dist/matter/errorHandler.js.map +1 -1
  139. package/dist/matter/errors.d.ts +0 -132
  140. package/dist/matter/errors.d.ts.map +1 -1
  141. package/dist/matter/errors.js +0 -132
  142. package/dist/matter/errors.js.map +1 -1
  143. package/dist/matter/index.d.ts +0 -30
  144. package/dist/matter/index.d.ts.map +1 -1
  145. package/dist/matter/index.js +0 -13
  146. package/dist/matter/index.js.map +1 -1
  147. package/dist/matter/logFormatter.d.ts +0 -17
  148. package/dist/matter/logFormatter.d.ts.map +1 -1
  149. package/dist/matter/logFormatter.js +5 -63
  150. package/dist/matter/logFormatter.js.map +1 -1
  151. package/dist/matter/server.d.ts +12 -236
  152. package/dist/matter/server.d.ts.map +1 -1
  153. package/dist/matter/server.js +177 -488
  154. package/dist/matter/server.js.map +1 -1
  155. package/dist/matter/serverHelpers.d.ts +0 -56
  156. package/dist/matter/serverHelpers.d.ts.map +1 -1
  157. package/dist/matter/serverHelpers.js +1 -66
  158. package/dist/matter/serverHelpers.js.map +1 -1
  159. package/dist/matter/sharedTypes.d.ts +0 -83
  160. package/dist/matter/sharedTypes.d.ts.map +1 -1
  161. package/dist/matter/sharedTypes.js +0 -26
  162. package/dist/matter/sharedTypes.js.map +1 -1
  163. package/dist/matter/storage.d.ts +0 -90
  164. package/dist/matter/storage.d.ts.map +1 -1
  165. package/dist/matter/storage.js +2 -130
  166. package/dist/matter/storage.js.map +1 -1
  167. package/dist/matter/typeHelpers.d.ts +0 -30
  168. package/dist/matter/typeHelpers.d.ts.map +1 -1
  169. package/dist/matter/typeHelpers.js +0 -24
  170. package/dist/matter/typeHelpers.js.map +1 -1
  171. package/dist/matter/types.d.ts +0 -273
  172. package/dist/matter/types.d.ts.map +1 -1
  173. package/dist/matter/types.js +0 -83
  174. package/dist/matter/types.js.map +1 -1
  175. package/dist/platformAccessory.d.ts +0 -15
  176. package/dist/platformAccessory.d.ts.map +1 -1
  177. package/dist/platformAccessory.js +6 -32
  178. package/dist/platformAccessory.js.map +1 -1
  179. package/dist/plugin.d.ts +0 -3
  180. package/dist/plugin.d.ts.map +1 -1
  181. package/dist/plugin.js +6 -29
  182. package/dist/plugin.js.map +1 -1
  183. package/dist/pluginManager.d.ts +0 -22
  184. package/dist/pluginManager.d.ts.map +1 -1
  185. package/dist/pluginManager.js +18 -41
  186. package/dist/pluginManager.js.map +1 -1
  187. package/dist/server.d.ts +9 -29
  188. package/dist/server.d.ts.map +1 -1
  189. package/dist/server.js +308 -157
  190. package/dist/server.js.map +1 -1
  191. package/dist/user.d.ts +0 -3
  192. package/dist/user.d.ts.map +1 -1
  193. package/dist/user.js +2 -5
  194. package/dist/user.js.map +1 -1
  195. package/dist/util/mac.js +0 -1
  196. package/dist/util/mac.js.map +1 -1
  197. package/package.json +4 -4
  198. package/dist/api.spec.d.ts +0 -2
  199. package/dist/api.spec.d.ts.map +0 -1
  200. package/dist/api.spec.js +0 -413
  201. package/dist/api.spec.js.map +0 -1
  202. package/dist/logger.spec.d.ts +0 -2
  203. package/dist/logger.spec.d.ts.map +0 -1
  204. package/dist/logger.spec.js +0 -95
  205. package/dist/logger.spec.js.map +0 -1
  206. package/dist/matter/ExternalMatterAccessoryPublisher.spec.d.ts +0 -2
  207. package/dist/matter/ExternalMatterAccessoryPublisher.spec.d.ts.map +0 -1
  208. package/dist/matter/ExternalMatterAccessoryPublisher.spec.js +0 -293
  209. package/dist/matter/ExternalMatterAccessoryPublisher.spec.js.map +0 -1
  210. package/dist/matter/accessoryCache.spec.d.ts +0 -2
  211. package/dist/matter/accessoryCache.spec.d.ts.map +0 -1
  212. package/dist/matter/accessoryCache.spec.js +0 -452
  213. package/dist/matter/accessoryCache.spec.js.map +0 -1
  214. package/dist/matter/behaviors/AirQualityBehavior.spec.d.ts +0 -5
  215. package/dist/matter/behaviors/AirQualityBehavior.spec.d.ts.map +0 -1
  216. package/dist/matter/behaviors/AirQualityBehavior.spec.js +0 -46
  217. package/dist/matter/behaviors/AirQualityBehavior.spec.js.map +0 -1
  218. package/dist/matter/behaviors/BehaviorRegistry.spec.d.ts +0 -2
  219. package/dist/matter/behaviors/BehaviorRegistry.spec.d.ts.map +0 -1
  220. package/dist/matter/behaviors/BehaviorRegistry.spec.js +0 -307
  221. package/dist/matter/behaviors/BehaviorRegistry.spec.js.map +0 -1
  222. package/dist/matter/behaviors/ColorControlBehavior.spec.d.ts +0 -2
  223. package/dist/matter/behaviors/ColorControlBehavior.spec.d.ts.map +0 -1
  224. package/dist/matter/behaviors/ColorControlBehavior.spec.js +0 -29
  225. package/dist/matter/behaviors/ColorControlBehavior.spec.js.map +0 -1
  226. package/dist/matter/behaviors/ConcentrationMeasurementBehavior.spec.d.ts +0 -5
  227. package/dist/matter/behaviors/ConcentrationMeasurementBehavior.spec.d.ts.map +0 -1
  228. package/dist/matter/behaviors/ConcentrationMeasurementBehavior.spec.js +0 -95
  229. package/dist/matter/behaviors/ConcentrationMeasurementBehavior.spec.js.map +0 -1
  230. package/dist/matter/behaviors/DoorLockBehavior.spec.d.ts +0 -2
  231. package/dist/matter/behaviors/DoorLockBehavior.spec.d.ts.map +0 -1
  232. package/dist/matter/behaviors/DoorLockBehavior.spec.js +0 -120
  233. package/dist/matter/behaviors/DoorLockBehavior.spec.js.map +0 -1
  234. package/dist/matter/behaviors/FanControlBehavior.spec.d.ts +0 -2
  235. package/dist/matter/behaviors/FanControlBehavior.spec.d.ts.map +0 -1
  236. package/dist/matter/behaviors/FanControlBehavior.spec.js +0 -23
  237. package/dist/matter/behaviors/FanControlBehavior.spec.js.map +0 -1
  238. package/dist/matter/behaviors/IdentifyBehavior.spec.d.ts +0 -2
  239. package/dist/matter/behaviors/IdentifyBehavior.spec.d.ts.map +0 -1
  240. package/dist/matter/behaviors/IdentifyBehavior.spec.js +0 -64
  241. package/dist/matter/behaviors/IdentifyBehavior.spec.js.map +0 -1
  242. package/dist/matter/behaviors/LevelControlBehavior.spec.d.ts +0 -2
  243. package/dist/matter/behaviors/LevelControlBehavior.spec.d.ts.map +0 -1
  244. package/dist/matter/behaviors/LevelControlBehavior.spec.js +0 -145
  245. package/dist/matter/behaviors/LevelControlBehavior.spec.js.map +0 -1
  246. package/dist/matter/behaviors/OnOffBehavior.spec.d.ts +0 -2
  247. package/dist/matter/behaviors/OnOffBehavior.spec.d.ts.map +0 -1
  248. package/dist/matter/behaviors/OnOffBehavior.spec.js +0 -128
  249. package/dist/matter/behaviors/OnOffBehavior.spec.js.map +0 -1
  250. package/dist/matter/behaviors/RvcCleanModeBehavior.spec.d.ts +0 -2
  251. package/dist/matter/behaviors/RvcCleanModeBehavior.spec.d.ts.map +0 -1
  252. package/dist/matter/behaviors/RvcCleanModeBehavior.spec.js +0 -57
  253. package/dist/matter/behaviors/RvcCleanModeBehavior.spec.js.map +0 -1
  254. package/dist/matter/behaviors/RvcOperationalStateBehavior.spec.d.ts +0 -2
  255. package/dist/matter/behaviors/RvcOperationalStateBehavior.spec.d.ts.map +0 -1
  256. package/dist/matter/behaviors/RvcOperationalStateBehavior.spec.js +0 -55
  257. package/dist/matter/behaviors/RvcOperationalStateBehavior.spec.js.map +0 -1
  258. package/dist/matter/behaviors/RvcRunModeBehavior.spec.d.ts +0 -2
  259. package/dist/matter/behaviors/RvcRunModeBehavior.spec.d.ts.map +0 -1
  260. package/dist/matter/behaviors/RvcRunModeBehavior.spec.js +0 -57
  261. package/dist/matter/behaviors/RvcRunModeBehavior.spec.js.map +0 -1
  262. package/dist/matter/behaviors/ServiceAreaBehavior.spec.d.ts +0 -2
  263. package/dist/matter/behaviors/ServiceAreaBehavior.spec.d.ts.map +0 -1
  264. package/dist/matter/behaviors/ServiceAreaBehavior.spec.js +0 -53
  265. package/dist/matter/behaviors/ServiceAreaBehavior.spec.js.map +0 -1
  266. package/dist/matter/behaviors/ThermostatBehavior.spec.d.ts +0 -2
  267. package/dist/matter/behaviors/ThermostatBehavior.spec.d.ts.map +0 -1
  268. package/dist/matter/behaviors/ThermostatBehavior.spec.js +0 -23
  269. package/dist/matter/behaviors/ThermostatBehavior.spec.js.map +0 -1
  270. package/dist/matter/behaviors/WindowCoveringBehavior.spec.d.ts +0 -2
  271. package/dist/matter/behaviors/WindowCoveringBehavior.spec.d.ts.map +0 -1
  272. package/dist/matter/behaviors/WindowCoveringBehavior.spec.js +0 -27
  273. package/dist/matter/behaviors/WindowCoveringBehavior.spec.js.map +0 -1
  274. package/dist/matter/configValidator.spec.d.ts +0 -2
  275. package/dist/matter/configValidator.spec.d.ts.map +0 -1
  276. package/dist/matter/configValidator.spec.js +0 -390
  277. package/dist/matter/configValidator.spec.js.map +0 -1
  278. package/dist/matter/errorHandler.spec.d.ts +0 -2
  279. package/dist/matter/errorHandler.spec.d.ts.map +0 -1
  280. package/dist/matter/errorHandler.spec.js +0 -159
  281. package/dist/matter/errorHandler.spec.js.map +0 -1
  282. package/dist/matter/logFormatter.spec.d.ts +0 -2
  283. package/dist/matter/logFormatter.spec.d.ts.map +0 -1
  284. package/dist/matter/logFormatter.spec.js +0 -252
  285. package/dist/matter/logFormatter.spec.js.map +0 -1
  286. package/dist/matter/serverHelpers.spec.d.ts +0 -2
  287. package/dist/matter/serverHelpers.spec.d.ts.map +0 -1
  288. package/dist/matter/serverHelpers.spec.js +0 -527
  289. package/dist/matter/serverHelpers.spec.js.map +0 -1
  290. package/dist/matter/storage.spec.d.ts +0 -2
  291. package/dist/matter/storage.spec.d.ts.map +0 -1
  292. package/dist/matter/storage.spec.js +0 -570
  293. package/dist/matter/storage.spec.js.map +0 -1
  294. package/dist/matter/typeHelpers.spec.d.ts +0 -2
  295. package/dist/matter/typeHelpers.spec.d.ts.map +0 -1
  296. package/dist/matter/typeHelpers.spec.js +0 -127
  297. package/dist/matter/typeHelpers.spec.js.map +0 -1
  298. package/dist/platformAccessory.spec.d.ts +0 -2
  299. package/dist/platformAccessory.spec.d.ts.map +0 -1
  300. package/dist/platformAccessory.spec.js +0 -126
  301. package/dist/platformAccessory.spec.js.map +0 -1
  302. package/dist/pluginManager.spec.d.ts +0 -2
  303. package/dist/pluginManager.spec.d.ts.map +0 -1
  304. package/dist/pluginManager.spec.js +0 -43
  305. package/dist/pluginManager.spec.js.map +0 -1
  306. package/dist/server.spec.d.ts +0 -2
  307. package/dist/server.spec.d.ts.map +0 -1
  308. package/dist/server.spec.js +0 -57
  309. package/dist/server.spec.js.map +0 -1
  310. package/dist/user.spec.d.ts +0 -2
  311. package/dist/user.spec.d.ts.map +0 -1
  312. package/dist/user.spec.js +0 -31
  313. package/dist/user.spec.js.map +0 -1
  314. package/dist/util/mac.spec.d.ts +0 -2
  315. package/dist/util/mac.spec.d.ts.map +0 -1
  316. package/dist/util/mac.spec.js +0 -36
  317. package/dist/util/mac.spec.js.map +0 -1
  318. package/dist/version.spec.d.ts +0 -2
  319. package/dist/version.spec.d.ts.map +0 -1
  320. package/dist/version.spec.js +0 -20
  321. package/dist/version.spec.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"errorHandler.js","sourceRoot":"","sources":["../../src/matter/errorHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAA;AAEnB,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;AAE9C;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IACrB,MAAM,CAAC,QAAQ,CA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w
5
- * to send specific Matter protocol status codes to controllers.
6
- *
7
- * When a handler throws one of these errors, the Matter server will send
8
- * the appropriate status code to the controller (e.g., Home app) instead
9
- * of crashing the endpoint.
10
- *
11
- * @example
12
- * ```typescript
13
- * import { MatterStatus } from 'homebridge'
14
- *
15
- * handlers: {
16
- * onOff: {
17
- * on: async () => {
18
- * if (deviceIsBusy) {
19
- * throw new MatterStatus.Busy('Device is processing another command')
20
- * }
21
- * if (requestTimedOut) {
22
- * throw new MatterStatus.Timeout('Device did not respond in time')
23
- * }
24
- * // ... control device
25
- * }
26
- * }
27
- * }
28
- * ```
29
- */
30
1
  import { Status, StatusResponseError } from '@matter/main/types';
31
- /**
32
- * Base class for all Matter protocol errors
33
- * Plugins can throw this directly or use specific error classes below
34
- */
35
2
  export declare class MatterProtocolError extends StatusResponseError {
36
3
  constructor(message: string, code: Status, clusterCode?: number);
37
4
  }
38
- /**
39
- * Device is busy processing another action (Status.Busy = 156)
40
- *
41
- * Use when the device cannot handle the request because it's processing another operation.
42
- *
43
- * @example
44
- * ```typescript
45
- * throw new MatterStatus.Busy('Device is currently processing another command')
46
- * ```
47
- */
48
5
  export declare class Busy extends MatterProtocolError {
49
6
  constructor(message?: string);
50
7
  }
51
- /**
52
- * Operation timed out (Status.Timeout = 148)
53
- *
54
- * Use when the device or operation times out.
55
- *
56
- * @example
57
- * ```typescript
58
- * throw new MatterStatus.Timeout('Device did not respond within 5 seconds')
59
- * ```
60
- */
61
8
  export declare class Timeout extends MatterProtocolError {
62
9
  constructor(message?: string);
63
10
  }
64
- /**
65
- * Value out of range or invalid (Status.ConstraintError = 135)
66
- *
67
- * Use when a value is out of bounds or doesn't meet constraints.
68
- *
69
- * @example
70
- * ```typescript
71
- * throw new MatterStatus.ConstraintError('Brightness must be between 0-254')
72
- * ```
73
- */
74
11
  export declare class ConstraintError extends MatterProtocolError {
75
12
  constructor(message?: string);
76
13
  }
77
- /**
78
- * Malformed action or invalid values (Status.InvalidAction = 128)
79
- *
80
- * Use when the command or action is malformed or has invalid field values.
81
- *
82
- * @example
83
- * ```typescript
84
- * throw new MatterStatus.InvalidAction('Invalid color value provided')
85
- * ```
86
- */
87
14
  export declare class InvalidAction extends MatterProtocolError {
88
15
  constructor(message?: string);
89
16
  }
90
- /**
91
- * Current operational state prevents the action (Status.InvalidInState = 203)
92
- *
93
- * Use when the device state prevents the requested operation.
94
- *
95
- * @example
96
- * ```typescript
97
- * throw new MatterStatus.InvalidInState('Cannot unlock door while security system is armed')
98
- * ```
99
- */
100
17
  export declare class InvalidInState extends MatterProtocolError {
101
18
  constructor(message?: string);
102
19
  }
103
- /**
104
- * Generic failure (Status.Failure = 1)
105
- *
106
- * Use as a fallback when no specific error applies.
107
- *
108
- * @example
109
- * ```typescript
110
- * throw new MatterStatus.Failure('Device returned an error')
111
- * ```
112
- */
113
20
  export declare class Failure extends MatterProtocolError {
114
21
  constructor(message?: string);
115
22
  }
116
- /**
117
- * Insufficient resources to process the request (Status.ResourceExhausted = 137)
118
- *
119
- * Use when the device has insufficient resources to handle the request.
120
- *
121
- * @example
122
- * ```typescript
123
- * throw new MatterStatus.ResourceExhausted('Maximum number of scenes reached')
124
- * ```
125
- */
126
23
  export declare class ResourceExhausted extends MatterProtocolError {
127
24
  constructor(message?: string);
128
25
  }
129
- /**
130
- * The sender does not have sufficient permissions (Status.PermissionDenied = 15)
131
- *
132
- * Use when access control prevents the operation.
133
- *
134
- * @example
135
- * ```typescript
136
- * throw new MatterStatus.PermissionDenied('User does not have permission to unlock')
137
- * ```
138
- */
139
26
  export declare class PermissionDenied extends MatterProtocolError {
140
27
  constructor(message?: string);
141
28
  }
142
- /**
143
- * The requested entity was not found (Status.NotFound = 139)
144
- *
145
- * Use when a requested resource or entity doesn't exist.
146
- *
147
- * @example
148
- * ```typescript
149
- * throw new MatterStatus.NotFound('Scene not found')
150
- * ```
151
- */
152
29
  export declare class NotFound extends MatterProtocolError {
153
30
  constructor(message?: string);
154
31
  }
155
- /**
156
- * Helper to check if an error is a Matter protocol error
157
- */
158
32
  export declare function isMatterProtocolError(error: unknown): error is MatterProtocolError;
159
- /**
160
- * Matter protocol status codes and error classes
161
- *
162
- * Use these error classes to signal specific error conditions to Matter controllers.
163
- * Each error class corresponds to a Matter protocol status code.
164
- */
165
33
  export declare const MatterStatus: {
166
34
  MatterProtocolError: typeof MatterProtocolError;
167
35
  Busy: typeof Busy;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/matter/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEhE;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,mBAAmB;gBAC9C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;CAGhE;AAED;;;;;;;;;GASG;AACH,qBAAa,IAAK,SAAQ,mBAAmB;gBAC/B,OAAO,SAAmB;CAGvC;AAED;;;;;;;;;GASG;AACH,qBAAa,OAAQ,SAAQ,mBAAmB;gBAClC,OAAO,SAAwB;CAG5C;AAED;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,mBAAmB;gBAC1C,OAAO,SAAkC;CAGtD;AAED;;;;;;;;;GASG;AACH,qBAAa,aAAc,SAAQ,mBAAmB;gBACxC,OAAO,SAA6B;CAGjD;AAED;;;;;;;;;GASG;AACH,qBAAa,cAAe,SAAQ,mBAAmB;gBACzC,OAAO,SAA2C;CAG/D;AAED;;;;;;;;;GASG;AACH,qBAAa,OAAQ,SAAQ,mBAAmB;gBAClC,OAAO,SAAqB;CAGzC;AAED;;;;;;;;;GASG;AACH,qBAAa,iBAAkB,SAAQ,mBAAmB;gBAC5C,OAAO,SAA2B;CAG/C;AAED;;;;;;;;;GASG;AACH,qBAAa,gBAAiB,SAAQ,mBAAmB;gBAC3C,OAAO,SAAsB;CAG1C;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
- /**
2
- * Matter Protocol Errors
3
- *
4
- * This module provides error classes that plugin developers can throw
5
- * to send specific Matter protocol status codes to controllers.
6
- *
7
- * When a handler throws one of these errors, the Matter server will send
8
- * the appropriate status code to the controller (e.g., Home app) instead
9
- * of crashing the endpoint.
10
- *
11
- * @example
12
- * ```typescript
13
- * import { MatterStatus } from 'homebridge'
14
- *
15
- * handlers: {
16
- * onOff: {
17
- * on: async () => {
18
- * if (deviceIsBusy) {
19
- * throw new MatterStatus.Busy('Device is processing another command')
20
- * }
21
- * if (requestTimedOut) {
22
- * throw new MatterStatus.Timeout('Device did not respond in time')
23
- * }
24
- * // ... control device
25
- * }
26
- * }
27
- * }
28
- * ```
29
- */
30
1
  import { Status, StatusResponseError } from '@matter/main/types';
31
- /**
32
- * Base class for all Matter protocol errors
33
- * Plugins can throw this directly or use specific error classes below
34
- */
35
2
  export class MatterProtocolError extends StatusResponseError {
36
3
  constructor(message, code, clusterCode) {
37
4
  super(message, code, clusterCode);
38
5
  }
39
6
  }
40
- /**
41
- * Device is busy processing another action (Status.Busy = 156)
42
- *
43
- * Use when the device cannot handle the request because it's processing another operation.
44
- *
45
- * @example
46
- * ```typescript
47
- * throw new MatterStatus.Busy('Device is currently processing another command')
48
- * ```
49
- */
50
7
  export class Busy extends MatterProtocolError {
51
8
  constructor(message = 'Device is busy') {
52
9
  super(message, Status.Busy);
53
10
  }
54
11
  }
55
- /**
56
- * Operation timed out (Status.Timeout = 148)
57
- *
58
- * Use when the device or operation times out.
59
- *
60
- * @example
61
- * ```typescript
62
- * throw new MatterStatus.Timeout('Device did not respond within 5 seconds')
63
- * ```
64
- */
65
12
  export class Timeout extends MatterProtocolError {
66
13
  constructor(message = 'Operation timed out') {
67
14
  super(message, Status.Timeout);
68
15
  }
69
16
  }
70
- /**
71
- * Value out of range or invalid (Status.ConstraintError = 135)
72
- *
73
- * Use when a value is out of bounds or doesn't meet constraints.
74
- *
75
- * @example
76
- * ```typescript
77
- * throw new MatterStatus.ConstraintError('Brightness must be between 0-254')
78
- * ```
79
- */
80
17
  export class ConstraintError extends MatterProtocolError {
81
18
  constructor(message = 'Value out of range or invalid') {
82
19
  super(message, Status.ConstraintError);
83
20
  }
84
21
  }
85
- /**
86
- * Malformed action or invalid values (Status.InvalidAction = 128)
87
- *
88
- * Use when the command or action is malformed or has invalid field values.
89
- *
90
- * @example
91
- * ```typescript
92
- * throw new MatterStatus.InvalidAction('Invalid color value provided')
93
- * ```
94
- */
95
22
  export class InvalidAction extends MatterProtocolError {
96
23
  constructor(message = 'Invalid action or values') {
97
24
  super(message, Status.InvalidAction);
98
25
  }
99
26
  }
100
- /**
101
- * Current operational state prevents the action (Status.InvalidInState = 203)
102
- *
103
- * Use when the device state prevents the requested operation.
104
- *
105
- * @example
106
- * ```typescript
107
- * throw new MatterStatus.InvalidInState('Cannot unlock door while security system is armed')
108
- * ```
109
- */
110
27
  export class InvalidInState extends MatterProtocolError {
111
28
  constructor(message = 'Operation not allowed in current state') {
112
29
  super(message, Status.InvalidInState);
113
30
  }
114
31
  }
115
- /**
116
- * Generic failure (Status.Failure = 1)
117
- *
118
- * Use as a fallback when no specific error applies.
119
- *
120
- * @example
121
- * ```typescript
122
- * throw new MatterStatus.Failure('Device returned an error')
123
- * ```
124
- */
125
32
  export class Failure extends MatterProtocolError {
126
33
  constructor(message = 'Operation failed') {
127
34
  super(message, Status.Failure);
128
35
  }
129
36
  }
130
- /**
131
- * Insufficient resources to process the request (Status.ResourceExhausted = 137)
132
- *
133
- * Use when the device has insufficient resources to handle the request.
134
- *
135
- * @example
136
- * ```typescript
137
- * throw new MatterStatus.ResourceExhausted('Maximum number of scenes reached')
138
- * ```
139
- */
140
37
  export class ResourceExhausted extends MatterProtocolError {
141
38
  constructor(message = 'Insufficient resources') {
142
39
  super(message, Status.ResourceExhausted);
143
40
  }
144
41
  }
145
- /**
146
- * The sender does not have sufficient permissions (Status.PermissionDenied = 15)
147
- *
148
- * Use when access control prevents the operation.
149
- *
150
- * @example
151
- * ```typescript
152
- * throw new MatterStatus.PermissionDenied('User does not have permission to unlock')
153
- * ```
154
- */
155
42
  export class PermissionDenied extends MatterProtocolError {
156
43
  constructor(message = 'Permission denied') {
157
44
  super(message, Status.UnsupportedAccess);
158
45
  }
159
46
  }
160
- /**
161
- * The requested entity was not found (Status.NotFound = 139)
162
- *
163
- * Use when a requested resource or entity doesn't exist.
164
- *
165
- * @example
166
- * ```typescript
167
- * throw new MatterStatus.NotFound('Scene not found')
168
- * ```
169
- */
170
47
  export class NotFound extends MatterProtocolError {
171
48
  constructor(message = 'Entity not found') {
172
49
  super(message, Status.NotFound);
173
50
  }
174
51
  }
175
- /**
176
- * Helper to check if an error is a Matter protocol error
177
- */
178
52
  export function isMatterProtocolError(error) {
179
53
  return error instanceof StatusResponseError;
180
54
  }
181
- /**
182
- * Matter protocol status codes and error classes
183
- *
184
- * Use these error classes to signal specific error conditions to Matter controllers.
185
- * Each error class corresponds to a Matter protocol status code.
186
- */
187
55
  export const MatterStatus = {
188
56
  MatterProtocolError,
189
57
  Busy,
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/matter/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEhE;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,mBAAmB;IAC1D,YAAY,OAAe,EAAE,IAAY,EAAE,WAAoB;QAC7D,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;IACnC,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,IAAK,SAAQ,mBAAmB;IAC3C,YAAY,OAAO,GAAG,gBAAgB;QACpC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IAC7B,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,OAAQ,SA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,OAAO,EAAE,MAAM,CAAC,aAAa,CAAC,CAAA;IACtC,CAAC;CACF;AAYD,MAAM,OAAO,cAAe,SAAQ,mBAAmB;IACrD,YAAY,OAAO,GAAG,wCAAwC;QAC5D,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,cAAc,CAAC,CAAA;IACvC,CAAC;CACF;AAYD,MAAM,OAAO,OAAQ,SAAQ,mBAAmB;IAC9C,YAAY,OAAO,GAAG,kBAAkB;QACtC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAChC,CAAC;CACF;AAYD,MAAM,OAAO,iBAAkB,SAAQ,mBAAmB;IACxD,YAAY,OAAO,GAAG,wBAAwB;QAC5C,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAC1C,CAAC;CACF;AAYD,MAAM,OAAO,gBAAiB,SAAQ,mBAAmB;IACvD,YAAY,OAAO,GAAG,mBAAmB;QACvC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAC1C,CAAC;CACF;AAYD,MAAM,OAAO,QAAS,SAAQ,mBAAmB;IAC/C,YAAY,OAAO,GAAG,kBAAkB;QACtC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;CACF;AAKD,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,OAAO,KAAK,YAAY,mBAAmB,CAAA;AAC7C,CAAC;AAQD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,mBAAmB;IACnB,IAAI;IACJ,OAAO;IACP,eAAe;IACf,aAAa;IACb,cAAc;IACd,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,QAAQ;IACR,qBAAqB;CACtB,CAAA"}
@@ -1,9 +1,3 @@
1
- /**
2
- * Matter Protocol Support for Homebridge
3
- *
4
- * This module provides Matter protocol support through a Plugin API,
5
- * allowing plugin developers to explicitly register Matter accessories.
6
- */
7
1
  import type { ColorControl, DoorLock, FanControl, Groups, Identify, LevelControl, ModeBase, OnOff, ScenesManagement, ServiceArea, Thermostat, WindowCovering } from '@matter/main/clusters';
8
2
  export { ChildBridgeMatterManager } from './ChildBridgeMatterManager.js';
9
3
  export { type MatterConfigValidationResult, MatterConfigValidator } from './configValidator.js';
@@ -13,23 +7,6 @@ export { MatterConfigCollector } from './MatterConfigCollector.js';
13
7
  export { MatterServer } from './server.js';
14
8
  export { HomebridgeMatterStorage, MatterStorageManager } from './storage.js';
15
9
  export { clusterNames, clusters, devices, deviceTypes, type InternalMatterAccessory, type MatterAccessory, type MatterAccessoryEventEmitter, MatterAccessoryEventTypes, type MatterClusterHandlers, type MatterClusterName, type MatterCommandHandler, MatterCommissioningError, type MatterConfig, MatterDeviceError, MatterError, type MatterErrorDetails, MatterErrorType, MatterNetworkError, MatterStorageError, } from './types.js';
16
- /**
17
- * Matter Cluster Command Request Types
18
- * Use these types for handler arguments to get full type safety
19
- *
20
- * @example
21
- * ```typescript
22
- * import type { MatterRequests } from 'homebridge'
23
- *
24
- * handlers: {
25
- * levelControl: {
26
- * moveToLevel: async (args: MatterRequests.MoveToLevel) => {
27
- * console.log(`Level: ${args.level}`)
28
- * }
29
- * }
30
- * }
31
- * ```
32
- */
33
10
  export declare namespace MatterRequests {
34
11
  type OffWithEffect = OnOff.OffWithEffectRequest;
35
12
  type OnWithTimedOff = OnOff.OnWithTimedOffRequest;
@@ -116,12 +93,5 @@ export declare namespace MatterRequests {
116
93
  type SelectAreas = ServiceArea.SelectAreasRequest;
117
94
  type SkipArea = ServiceArea.SkipAreaRequest;
118
95
  }
119
- /**
120
- * Matter Cluster Types & Enums
121
- * Import these to access type-safe enum values for cluster attributes using the original matter.js names.
122
- *
123
- * All 130+ Matter clusters are exported here with their original matter.js names, providing access to
124
- * enums, types, and constants with full TypeScript autocomplete support.
125
- */
126
96
  export * as MatterTypes from '@matter/main/clusters';
127
97
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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,2BAA2B,CAAA;IACvE,KAAY,kBAAkB,GAAG,QAAQ,CAAC,yBAAyB,CAAA;IACnE,KAAY,kBAAkB,GAAG,QAAQ,CAAC,yBAAyB,CAAA;IACnE,KAAY,oBAAoB,GAAG,QAAQ,CAAC,2BAA2B,CAAA;IACvE,KAAY,kBAAkB,GAAG,QAAQ,CAAC,yBAAyB,CAAA;IACnE,KAAY,kBAAkB,GAAG,QAAQ,CAAC,yBAAyB,CAAA;IACnE,KAAY,oBAAoB,GAAG,QAAQ,CAAC,2BAA2B,CAAA;IACvE,KAAY,oBAAoB,GAAG,QAAQ,CAAC,2BAA2B,CAAA;IAKvE,KAAY,kBAAkB,GAAG,cAAc,CAAC,yBAAyB,CAAA;IACzE,KAAY,kBAAkB,GAAG,cAAc,CAAC,yBAAyB,CAAA;IACzE,KAAY,aAAa,GAAG,cAAc,CAAC,oBAAoB,CAAA;IAC/D,KAAY,aAAa,GAAG,cAAc,CAAC,oBAAoB,CAAA;IAK/D,KAAY,kBAAkB,GAAG,UAAU,CAAC,yBAAyB,CAAA;IACrE,KAAY,eAAe,GAAG,UAAU,CAAC,sBAAsB,CAAA;IAC/D,KAAY,iBAAiB,GAAG,UAAU,CAAC,wBAAwB,CAAA;IACnE,KAAY,iBAAiB,GAAG,UAAU,CAAC,wBAAwB,CAAA;IACnE,KAAY,iBAAiB,GAAG,UAAU,CAAC,wBAAwB,CAAA;IAKnE,KAAY,OAAO,GAAG,UAAU,CAAC,WAAW,CAAA;IAK5C,KAAY,YAAY,GAAG,QAAQ,CAAC,mBAAmB,CAAA;IAKvD,KAAY,WAAW,GAAG,WAAW,CAAC,kBAAkB,CAAA;IACxD,KAAY,QAAQ,GAAG,WAAW,CAAC,eAAe,CAAA;CACnD;AASD,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA"}
@@ -1,9 +1,3 @@
1
- /**
2
- * Matter Protocol Support for Homebridge
3
- *
4
- * This module provides Matter protocol support through a Plugin API,
5
- * allowing plugin developers to explicitly register Matter accessories.
6
- */
7
1
  export { ChildBridgeMatterManager } from './ChildBridgeMatterManager.js';
8
2
  export { MatterConfigValidator } from './configValidator.js';
9
3
  export { MatterStatus } from './errors.js';
@@ -12,12 +6,5 @@ export { MatterConfigCollector } from './MatterConfigCollector.js';
12
6
  export { MatterServer } from './server.js';
13
7
  export { HomebridgeMatterStorage, MatterStorageManager } from './storage.js';
14
8
  export { clusterNames, clusters, devices, deviceTypes, MatterAccessoryEventTypes, MatterCommissioningError, MatterDeviceError, MatterError, MatterErrorType, MatterNetworkError, MatterStorageError, } from './types.js';
15
- /**
16
- * Matter Cluster Types & Enums
17
- * Import these to access type-safe enum values for cluster attributes using the original matter.js names.
18
- *
19
- * All 130+ Matter clusters are exported here with their original matter.js names, providing access to
20
- * enums, types, and constants with full TypeScript autocomplete support.
21
- */
22
9
  export * as MatterTypes from '@matter/main/clusters';
23
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/matter/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAqC,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,WAAW,EAIX,yBAAyB,EAIzB,wBAAwB,EAExB,iBAAiB,EACjB,WAAW,EAEX,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAA;AA0JnB;;;;;;GAMG;AACH,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/matter/index.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAqC,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,WAAW,EAIX,yBAAyB,EAIzB,wBAAwB,EAExB,iBAAiB,EACjB,WAAW,EAEX,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAA;AAiKnB,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA"}
@@ -1,19 +1,2 @@
1
- /**
2
- * Matter.js Log Formatter
3
- *
4
- * Formats Matter.js library logs to match the homebridge log format and color scheme.
5
- * This ensures consistent logging output across Homebridge and Matter.js.
6
- */
7
- /**
8
- * Create a custom log formatter that matches the homebridge format.
9
- * Format: [timestamp] [Matter:Facility] message
10
- * Timestamp format matches system locale (via toLocaleString()).
11
- *
12
- * Log level color mapping:
13
- * - Matter DEBUG/INFO → gray (Homebridge debug)
14
- * - Matter NOTICE → no color (Homebridge info)
15
- * - Matter WARN → yellow (Homebridge warn)
16
- * - Matter ERROR/FATAL → red (Homebridge error)
17
- */
18
1
  export declare function createHomebridgeLogFormatter(): (diagnostic: unknown) => string;
19
2
  //# sourceMappingURL=logFormatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logFormatter.d.ts","sourceRoot":"","sources":["../../src/matter/logFormatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,IAAI,CAAC,UAAU,EAAE,OAAO,KAAK,MAAM,CAuE9E"}
1
+ {"version":3,"file":"logFormatter.d.ts","sourceRoot":"","sources":["../../src/matter/logFormatter.ts"],"names":[],"mappings":"AAuBA,wBAAgB,4BAA4B,IAAI,CAAC,UAAU,EAAE,OAAO,KAAK,MAAM,CAuE9E"}
@@ -1,106 +1,54 @@
1
- /**
2
- * Matter.js Log Formatter
3
- *
4
- * Formats Matter.js library logs to match the homebridge log format and color scheme.
5
- * This ensures consistent logging output across Homebridge and Matter.js.
6
- */
7
1
  import { Diagnostic } from '@matter/general';
8
2
  import chalk from 'chalk';
9
3
  import { Logger } from '../logger.js';
10
- /**
11
- * Create a custom log formatter that matches the homebridge format.
12
- * Format: [timestamp] [Matter:Facility] message
13
- * Timestamp format matches system locale (via toLocaleString()).
14
- *
15
- * Log level color mapping:
16
- * - Matter DEBUG/INFO → gray (Homebridge debug)
17
- * - Matter NOTICE → no color (Homebridge info)
18
- * - Matter WARN → yellow (Homebridge warn)
19
- * - Matter ERROR/FATAL → red (Homebridge error)
20
- */
21
4
  export function createHomebridgeLogFormatter() {
22
- // Capture timestamp setting once when formatter is created
23
5
  const timestampEnabled = Logger.isTimestampEnabled();
24
6
  return (diagnostic) => {
25
- // Check if this is a Matter.js log message
26
7
  if (typeof diagnostic === 'object' && diagnostic !== null) {
27
8
  const msg = diagnostic;
28
- // If it's a log message with the expected structure
29
9
  if (msg.now && msg.facility && msg.values) {
30
- // Suppress ValidatedElements logs - these are just validation warnings about
31
- // optional Matter.js features that aren't implemented (and don't need to be)
32
10
  if (msg.facility === 'ValidatedElements' || msg.facility === 'Commissioning') {
33
11
  return '';
34
12
  }
35
- // Format facility as [Matter:FacilityName] in cyan color
36
13
  const facility = formatCyan(`[Matter/${msg.facility}]`);
37
- // Extract the message text from values
38
14
  let messageText = formatMessageValues(msg.values);
39
- // Trim excessively long messages from verbose facilities like MessageChannel
40
15
  if (msg.facility === 'MessageChannel' && messageText.length > 200) {
41
16
  messageText = `${messageText.substring(0, 200)} [trimmed...]`;
42
17
  }
43
- // Apply color based on Matter log level
44
- // Matter DEBUG/INFO → gray (Homebridge debug)
45
- // Matter NOTICE → no color (Homebridge info)
46
- // Matter WARN → yellow (Homebridge warn)
47
- // Matter ERROR/FATAL → red (Homebridge error)
48
- // For 'notice' or anything else, leave it uncolored (Homebridge info style)
49
18
  let coloredMessage = messageText;
50
19
  if (msg.level !== undefined) {
51
20
  switch (msg.level) {
52
- // export const DEBUG: LogLevel = 0;
53
- // export const INFO: LogLevel = 1;
54
- // export const NOTICE: LogLevel = 2;
55
- // export const WARN: LogLevel = 3;
56
- // export const ERROR: LogLevel = 4;
57
- // export const FATAL: LogLevel = 5;
58
- case 5: // FATAL
59
- case 4: // ERROR
21
+ case 5:
22
+ case 4:
60
23
  coloredMessage = chalk.red(messageText);
61
24
  break;
62
- case 3: // WARN
25
+ case 3:
63
26
  coloredMessage = chalk.yellow(messageText);
64
27
  break;
65
- case 0: // DEBUG
28
+ case 0:
66
29
  coloredMessage = chalk.gray(messageText);
67
30
  break;
68
31
  }
69
32
  }
70
- // Check if timestamps are enabled (respects --no-timestamp flag)
71
33
  if (timestampEnabled) {
72
- // Format timestamp to match Homebridge format using toLocaleString() in white
73
34
  const timestamp = formatHomebridgeTimestamp(msg.now);
74
35
  return `${timestamp} ${facility} ${coloredMessage}`;
75
36
  }
76
37
  else {
77
- // No timestamp
78
38
  return `${facility} ${coloredMessage}`;
79
39
  }
80
40
  }
81
41
  }
82
- // Fallback for non-message diagnostics
83
42
  return String(diagnostic);
84
43
  };
85
44
  }
86
- /**
87
- * Format a date object to Homebridge timestamp format.
88
- * Uses toLocaleString() to match the main logger's format and respect system locale/timezone.
89
- * Returns the timestamp in white color to match main logger.
90
- */
91
45
  function formatHomebridgeTimestamp(date) {
92
46
  const timestamp = `[${date.toLocaleString()}]`;
93
47
  return chalk.white(timestamp);
94
48
  }
95
- /**
96
- * Format text in cyan color using chalk
97
- */
98
49
  function formatCyan(text) {
99
50
  return chalk.cyan(text);
100
51
  }
101
- /**
102
- * Format the message values array into a readable string
103
- */
104
52
  function formatMessageValues(values) {
105
53
  if (!Array.isArray(values)) {
106
54
  return String(values);
@@ -113,7 +61,6 @@ function formatMessageValues(values) {
113
61
  if (value === undefined) {
114
62
  return 'undefined';
115
63
  }
116
- // Matter.js uses lazy logging - call functions to get the actual message
117
64
  if (typeof value === 'function') {
118
65
  try {
119
66
  return String(value());
@@ -123,21 +70,16 @@ function formatMessageValues(values) {
123
70
  }
124
71
  }
125
72
  if (typeof value === 'object') {
126
- // Check if this is a Matter.js Diagnostic object
127
- // These objects store their actual value in a symbol property
128
73
  const diagnosticValue = Diagnostic.valueOf(value);
129
74
  if (diagnosticValue !== undefined && diagnosticValue !== value) {
130
- // If diagnosticValue is an array, format each element individually
131
75
  if (Array.isArray(diagnosticValue)) {
132
76
  return formatMessageValues(diagnosticValue);
133
77
  }
134
- // Otherwise, recursively format the single value
135
78
  return formatMessageValues([diagnosticValue]);
136
79
  }
137
- // Special handling for error objects
138
80
  if (value instanceof Error) {
139
81
  const errorDetails = {
140
- ...value, // include any custom properties first
82
+ ...value,
141
83
  name: value.name,
142
84
  message: value.message,
143
85
  stack: value.stack,