@matterbridge/core 3.9.1-dev-20260614-89d7aeb → 3.9.1-dev-20260617-b1e1b99

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 (107) hide show
  1. package/README.md +5 -3
  2. package/dist/backend.js +17 -6
  3. package/dist/backendExpress.d.ts +1 -1
  4. package/dist/backendExpress.js +12 -12
  5. package/dist/backendWsServer.d.ts +1 -1
  6. package/dist/backendWsServer.js +3 -3
  7. package/dist/behaviors/activatedCarbonFilterMonitoringServer.d.ts +2 -2
  8. package/dist/behaviors/bindingServer.d.ts +4 -4
  9. package/dist/behaviors/bindingServer.js +2 -2
  10. package/dist/behaviors/booleanStateConfigurationServer.d.ts +2 -2
  11. package/dist/behaviors/booleanStateConfigurationServer.js +2 -1
  12. package/dist/behaviors/colorControlServer.d.ts +9 -9
  13. package/dist/behaviors/deviceEnergyManagementServer.d.ts +4 -4
  14. package/dist/behaviors/doorLockServer.d.ts +18 -18
  15. package/dist/behaviors/doorLockServer.js +2 -2
  16. package/dist/behaviors/fanControlServer.d.ts +2 -2
  17. package/dist/behaviors/hepaFilterMonitoringServer.d.ts +2 -2
  18. package/dist/behaviors/identifyServer.d.ts +1 -1
  19. package/dist/behaviors/levelControlServer.d.ts +1 -1
  20. package/dist/behaviors/matterbridgeServer.d.ts +2 -2
  21. package/dist/behaviors/modeSelectServer.d.ts +1 -1
  22. package/dist/behaviors/operationalStateServer.d.ts +1 -1
  23. package/dist/behaviors/serviceAreaServer.d.ts +1 -1
  24. package/dist/behaviors/smokeCoAlarmServer.d.ts +1 -1
  25. package/dist/behaviors/thermostatServer.d.ts +10 -10
  26. package/dist/behaviors/valveConfigurationAndControlServer.d.ts +1 -1
  27. package/dist/behaviors/windowCoveringServer.d.ts +7 -7
  28. package/dist/behaviors/windowCoveringServer.js +3 -3
  29. package/dist/cli.js +9 -9
  30. package/dist/cliEmitter.js +2 -2
  31. package/dist/cliHistory.js +2 -2
  32. package/dist/clusters/closure-control.d.ts +1 -1
  33. package/dist/clusters/closure-dimension.d.ts +1 -1
  34. package/dist/clusters/export.d.ts +1 -1
  35. package/dist/clusters/export.js +1 -1
  36. package/dist/clusters/soil-measurement.d.ts +1 -1
  37. package/dist/deviceManager.d.ts +1 -1
  38. package/dist/deviceManager.js +3 -4
  39. package/dist/devices/batteryStorage.js +2 -1
  40. package/dist/devices/closure.d.ts +6 -6
  41. package/dist/devices/closurePanel.d.ts +6 -6
  42. package/dist/devices/cooktop.d.ts +1 -1
  43. package/dist/devices/cooktop.js +2 -1
  44. package/dist/devices/dishwasher.d.ts +1 -1
  45. package/dist/devices/evse.d.ts +3 -3
  46. package/dist/devices/evse.js +4 -2
  47. package/dist/devices/extractorHood.js +2 -1
  48. package/dist/devices/heatPump.js +7 -8
  49. package/dist/devices/irrigationSystem.d.ts +1 -1
  50. package/dist/devices/laundryDryer.d.ts +1 -1
  51. package/dist/devices/laundryWasher.d.ts +1 -1
  52. package/dist/devices/oven.d.ts +2 -2
  53. package/dist/devices/oven.js +4 -3
  54. package/dist/devices/refrigerator.d.ts +2 -2
  55. package/dist/devices/refrigerator.js +2 -1
  56. package/dist/devices/solarPower.d.ts +1 -1
  57. package/dist/devices/solarPower.js +2 -1
  58. package/dist/devices/temperatureControl.d.ts +3 -3
  59. package/dist/devices/waterHeater.js +2 -1
  60. package/dist/export.js +2 -2
  61. package/dist/frontend.js +39 -39
  62. package/dist/helpers.d.ts +1 -1
  63. package/dist/helpers.js +6 -14
  64. package/dist/jestutils/jestBroadcastServerSpy.d.ts +13 -12
  65. package/dist/jestutils/jestBroadcastServerSpy.js +1 -1
  66. package/dist/jestutils/jestDeviceManagerSpy.d.ts +14 -13
  67. package/dist/jestutils/jestDeviceManagerSpy.js +1 -1
  68. package/dist/jestutils/jestFrontendSpy.d.ts +7 -9
  69. package/dist/jestutils/jestFrontendSpy.js +1 -1
  70. package/dist/jestutils/jestMatterTest.js +1 -1
  71. package/dist/jestutils/jestMatterbridgeEndpointSpy.d.ts +6 -54
  72. package/dist/jestutils/jestMatterbridgeEndpointSpy.js +1 -1
  73. package/dist/jestutils/jestMatterbridgePlatformSpy.d.ts +43 -60
  74. package/dist/jestutils/jestMatterbridgePlatformSpy.js +1 -1
  75. package/dist/jestutils/jestMatterbridgeSpy.d.ts +5 -4
  76. package/dist/jestutils/jestMatterbridgeSpy.js +1 -1
  77. package/dist/jestutils/jestMatterbridgeTest.d.ts +2 -2
  78. package/dist/jestutils/jestMatterbridgeTest.js +1 -1
  79. package/dist/jestutils/jestPluginManagerSpy.d.ts +40 -47
  80. package/dist/jestutils/jestPluginManagerSpy.js +1 -1
  81. package/dist/jestutils/jestSetupTest.d.ts +0 -1
  82. package/dist/jestutils/jestSetupTest.js +13 -12
  83. package/dist/jestutils/matterRequest.d.ts +1 -1
  84. package/dist/matterNode.js +8 -6
  85. package/dist/matterbridge.js +11 -21
  86. package/dist/matterbridgeAccessoryPlatform.d.ts +1 -1
  87. package/dist/matterbridgeAccessoryPlatform.js +2 -2
  88. package/dist/matterbridgeDeviceTypes.js +2 -2
  89. package/dist/matterbridgeDynamicPlatform.d.ts +1 -1
  90. package/dist/matterbridgeDynamicPlatform.js +2 -2
  91. package/dist/matterbridgeEndpoint.d.ts +9 -9
  92. package/dist/matterbridgeEndpoint.js +9 -8
  93. package/dist/matterbridgeEndpointCommandHandler.d.ts +40 -40
  94. package/dist/matterbridgeEndpointCommandHandler.js +2 -2
  95. package/dist/matterbridgeEndpointHelpers.d.ts +23 -23
  96. package/dist/matterbridgeEndpointHelpers.js +3 -4
  97. package/dist/matterbridgeEndpointTypes.js +2 -3
  98. package/dist/matterbridgeFactory.d.ts +1 -1
  99. package/dist/matterbridgeFactory.js +2 -2
  100. package/dist/matterbridgePlatform.d.ts +1 -1
  101. package/dist/matterbridgePlatform.js +2 -2
  102. package/dist/mb_coap.js +3 -1
  103. package/dist/mb_health.js +3 -1
  104. package/dist/mb_mdns.js +10 -7
  105. package/dist/pluginManager.d.ts +1 -1
  106. package/dist/pluginManager.js +11 -6
  107. package/package.json +7 -7
@@ -1,60 +1,43 @@
1
- export declare const destroyMatterbridgePlatformSpy: import("jest-mock").SpiedGetter<string | boolean | import("node-ansi-logger").AnsiLogger | import("node-persist-manager").NodeStorage | import("../matterbridgePlatform.js").PlatformMatterbridge | Promise<void> | import("../matterbridgePlatform.js").PlatformConfig> | import("jest-mock").SpiedSetter<string | boolean | import("node-ansi-logger").AnsiLogger | import("node-persist-manager").NodeStorage | import("../matterbridgePlatform.js").PlatformMatterbridge | Promise<void> | import("../matterbridgePlatform.js").PlatformConfig>;
2
- export declare const onStartMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(reason?: string) => Promise<void>>;
3
- export declare const onConfigureMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<() => Promise<void>>;
4
- export declare const onShutdownMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(reason?: string) => Promise<void>>;
5
- export declare const onChangeLoggerLevelMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(logLevel: import("node-ansi-logger").LogLevel) => Promise<void>>;
6
- export declare const onActionMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(action: string, value?: string, id?: string, formData?: import("../matterbridgePlatform.js").PlatformConfig) => Promise<void>>;
7
- export declare const onConfigChangedMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(config: import("../matterbridgePlatform.js").PlatformConfig) => Promise<void>>;
8
- export declare const saveConfigMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(config: import("../matterbridgePlatform.js").PlatformConfig) => void>;
9
- export declare const getSchemaMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<() => Promise<import("../matterbridgePlatform.js").PlatformSchema | undefined>>;
10
- export declare const setSchemaMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(schema: import("../matterbridgePlatform.js").PlatformSchema) => void>;
11
- export declare const wssSendRestartRequiredMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(snackbar?: boolean, fixed?: boolean) => void>;
12
- export declare const wssSendSnackbarMessageMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(message: string, timeout?: number, severity?: 'error' | 'success' | 'info' | 'warning') => void>;
13
- export declare const sizeMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<() => number>;
14
- export declare const getDevicesMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<() => import("../matterbridgeEndpoint.js").MatterbridgeEndpoint[]>;
15
- export declare const getDeviceByNameMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(deviceName: string) => import("../matterbridgeEndpoint.js").MatterbridgeEndpoint | undefined>;
16
- export declare const getDeviceByUniqueIdMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(uniqueId: string) => import("../matterbridgeEndpoint.js").MatterbridgeEndpoint | undefined>;
17
- export declare const getDeviceBySerialNumberMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(serialNumber: string) => import("../matterbridgeEndpoint.js").MatterbridgeEndpoint | undefined>;
18
- export declare const getDeviceByIdMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(id: string) => import("../matterbridgeEndpoint.js").MatterbridgeEndpoint | undefined>;
19
- export declare const getDeviceByOriginalIdMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(originalId: string) => import("../matterbridgeEndpoint.js").MatterbridgeEndpoint | undefined>;
20
- export declare const getDeviceByNumberMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(number: import("@matter/types").EndpointNumber | number) => import("../matterbridgeEndpoint.js").MatterbridgeEndpoint | undefined>;
21
- export declare const hasDeviceNameMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(deviceName: string) => boolean>;
22
- export declare const hasDeviceUniqueIdMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(deviceUniqueId: string) => boolean>;
23
- export declare const registerVirtualDeviceMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(name: string, type: 'light' | 'outlet' | 'switch' | 'mounted_switch', callback: () => Promise<void>) => Promise<boolean>>;
24
- export declare const registerDeviceMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(device: import("../matterbridgeEndpoint.js").MatterbridgeEndpoint) => Promise<void>>;
25
- export declare const unregisterDeviceMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(device: import("../matterbridgeEndpoint.js").MatterbridgeEndpoint) => Promise<void>>;
26
- export declare const unregisterAllDevicesMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(delay?: number) => Promise<void>>;
27
- export declare const saveSelectsMatterbridgePlatformSpy: import("jest-mock").SpiedGetter<string | boolean | import("node-ansi-logger").AnsiLogger | import("node-persist-manager").NodeStorage | import("../matterbridgePlatform.js").PlatformMatterbridge | Promise<void> | import("../matterbridgePlatform.js").PlatformConfig> | import("jest-mock").SpiedSetter<string | boolean | import("node-ansi-logger").AnsiLogger | import("node-persist-manager").NodeStorage | import("../matterbridgePlatform.js").PlatformMatterbridge | Promise<void> | import("../matterbridgePlatform.js").PlatformConfig>;
28
- export declare const clearSelectMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<() => Promise<void>>;
29
- export declare const clearDeviceSelectMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(serial: string) => Promise<void>>;
30
- export declare const clearEntitySelectMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(name: string) => Promise<void>>;
31
- export declare const setSelectDeviceMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(serial: string, name: string, configUrl?: string, icon?: string, entities?: {
32
- name: string;
33
- description: string;
34
- icon?: string;
35
- }[]) => void>;
36
- export declare const getSelectDeviceMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(serial: string) => {
37
- serial: string;
38
- name: string;
39
- configUrl?: string;
40
- icon?: string;
41
- entities?: {
42
- name: string;
43
- description: string;
44
- icon?: string;
45
- }[];
46
- } | undefined>;
47
- export declare const setSelectDeviceEntityMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(serial: string, entityName: string, entityDescription: string, entityIcon?: string) => void>;
48
- export declare const getSelectDevicesMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<() => import("@matterbridge/types").ApiSelectDevice[]>;
49
- export declare const setSelectEntityMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(name: string, description: string, icon?: string) => void>;
50
- export declare const getSelectEntityMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(name: string) => {
51
- name: string;
52
- description: string;
53
- icon?: string | undefined;
54
- } | undefined>;
55
- export declare const getSelectEntitiesMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<() => import("@matterbridge/types").ApiSelectEntity[]>;
56
- export declare const verifyMatterbridgeVersionMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(requiredVersion: string, destroy?: boolean) => boolean>;
57
- export declare const validateDeviceMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(device: string | string[], log?: boolean) => boolean>;
58
- export declare const validateEntityMatterbridgePlatformSpy: import("jest-mock").SpiedFunction<(device: string, entity: string, log?: boolean) => boolean>;
59
- export declare const clearEndpointNumbersMatterbridgePlatformSpy: import("jest-mock").SpiedGetter<string | boolean | import("node-ansi-logger").AnsiLogger | import("node-persist-manager").NodeStorage | import("../matterbridgePlatform.js").PlatformMatterbridge | Promise<void> | import("../matterbridgePlatform.js").PlatformConfig> | import("jest-mock").SpiedSetter<string | boolean | import("node-ansi-logger").AnsiLogger | import("node-persist-manager").NodeStorage | import("../matterbridgePlatform.js").PlatformMatterbridge | Promise<void> | import("../matterbridgePlatform.js").PlatformConfig>;
60
- export declare const checkEndpointNumbersMatterbridgePlatformSpy: import("jest-mock").SpiedGetter<string | boolean | import("node-ansi-logger").AnsiLogger | import("node-persist-manager").NodeStorage | import("../matterbridgePlatform.js").PlatformMatterbridge | Promise<void> | import("../matterbridgePlatform.js").PlatformConfig> | import("jest-mock").SpiedSetter<string | boolean | import("node-ansi-logger").AnsiLogger | import("node-persist-manager").NodeStorage | import("../matterbridgePlatform.js").PlatformMatterbridge | Promise<void> | import("../matterbridgePlatform.js").PlatformConfig>;
1
+ import { MatterbridgePlatform } from '../matterbridgePlatform.js';
2
+ export declare const destroyMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.destroy>;
3
+ export declare const onStartMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.onStart>;
4
+ export declare const onConfigureMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.onConfigure>;
5
+ export declare const onShutdownMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.onShutdown>;
6
+ export declare const onChangeLoggerLevelMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.onChangeLoggerLevel>;
7
+ export declare const onActionMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.onAction>;
8
+ export declare const onConfigChangedMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.onConfigChanged>;
9
+ export declare const saveConfigMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.saveConfig>;
10
+ export declare const getSchemaMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getSchema>;
11
+ export declare const setSchemaMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.setSchema>;
12
+ export declare const wssSendRestartRequiredMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.wssSendRestartRequired>;
13
+ export declare const wssSendSnackbarMessageMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.wssSendSnackbarMessage>;
14
+ export declare const sizeMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.size>;
15
+ export declare const getDevicesMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getDevices>;
16
+ export declare const getDeviceByNameMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getDeviceByName>;
17
+ export declare const getDeviceByUniqueIdMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getDeviceByUniqueId>;
18
+ export declare const getDeviceBySerialNumberMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getDeviceBySerialNumber>;
19
+ export declare const getDeviceByIdMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getDeviceById>;
20
+ export declare const getDeviceByOriginalIdMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getDeviceByOriginalId>;
21
+ export declare const getDeviceByNumberMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getDeviceByNumber>;
22
+ export declare const hasDeviceNameMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.hasDeviceName>;
23
+ export declare const hasDeviceUniqueIdMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.hasDeviceUniqueId>;
24
+ export declare const registerVirtualDeviceMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.registerVirtualDevice>;
25
+ export declare const registerDeviceMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.registerDevice>;
26
+ export declare const unregisterDeviceMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.unregisterDevice>;
27
+ export declare const unregisterAllDevicesMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.unregisterAllDevices>;
28
+ export declare const saveSelectsMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.saveSelects>;
29
+ export declare const clearSelectMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.clearSelect>;
30
+ export declare const clearDeviceSelectMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.clearDeviceSelect>;
31
+ export declare const clearEntitySelectMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.clearEntitySelect>;
32
+ export declare const setSelectDeviceMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.setSelectDevice>;
33
+ export declare const getSelectDeviceMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getSelectDevice>;
34
+ export declare const setSelectDeviceEntityMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.setSelectDeviceEntity>;
35
+ export declare const getSelectDevicesMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getSelectDevices>;
36
+ export declare const setSelectEntityMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.setSelectEntity>;
37
+ export declare const getSelectEntityMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getSelectEntity>;
38
+ export declare const getSelectEntitiesMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.getSelectEntities>;
39
+ export declare const verifyMatterbridgeVersionMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.verifyMatterbridgeVersion>;
40
+ export declare const validateDeviceMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.validateDevice>;
41
+ export declare const validateEntityMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.validateEntity>;
42
+ export declare const clearEndpointNumbersMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.clearEndpointNumbers>;
43
+ export declare const checkEndpointNumbersMatterbridgePlatformSpy: jest.SpiedFunction<typeof MatterbridgePlatform.prototype.checkEndpointNumbers>;
@@ -1,5 +1,5 @@
1
- import { jest } from '@jest/globals';
2
1
  import { MatterbridgePlatform } from '../matterbridgePlatform.js';
2
+ const { jest } = await import('@jest/globals');
3
3
  export const destroyMatterbridgePlatformSpy = jest.spyOn(MatterbridgePlatform.prototype, 'destroy');
4
4
  export const onStartMatterbridgePlatformSpy = jest.spyOn(MatterbridgePlatform.prototype, 'onStart');
5
5
  export const onConfigureMatterbridgePlatformSpy = jest.spyOn(MatterbridgePlatform.prototype, 'onConfigure');
@@ -1,4 +1,5 @@
1
- export declare const addBridgedEndpointMatterbridgeSpy: import("jest-mock").SpiedFunction<(pluginName: string, device: import("../matterbridgeEndpoint.js").MatterbridgeEndpoint) => Promise<void>>;
2
- export declare const removeBridgedEndpointMatterbridgeSpy: import("jest-mock").SpiedFunction<(pluginName: string, device: import("../matterbridgeEndpoint.js").MatterbridgeEndpoint) => Promise<void>>;
3
- export declare const removeAllBridgedEndpointsMatterbridgeSpy: import("jest-mock").SpiedFunction<(pluginName: string, delay?: number) => Promise<void>>;
4
- export declare const addVirtualEndpointMatterbridgeSpy: import("jest-mock").SpiedFunction<(pluginName: string, name: string, type: 'light' | 'outlet' | 'switch' | 'mounted_switch', callback: () => Promise<void>) => Promise<boolean>>;
1
+ import { Matterbridge } from '../matterbridge.js';
2
+ export declare const addBridgedEndpointMatterbridgeSpy: jest.SpiedFunction<typeof Matterbridge.prototype.addBridgedEndpoint>;
3
+ export declare const removeBridgedEndpointMatterbridgeSpy: jest.SpiedFunction<typeof Matterbridge.prototype.removeBridgedEndpoint>;
4
+ export declare const removeAllBridgedEndpointsMatterbridgeSpy: jest.SpiedFunction<typeof Matterbridge.prototype.removeAllBridgedEndpoints>;
5
+ export declare const addVirtualEndpointMatterbridgeSpy: jest.SpiedFunction<typeof Matterbridge.prototype.addVirtualEndpoint>;
@@ -1,5 +1,5 @@
1
- import { jest } from '@jest/globals';
2
1
  import { Matterbridge } from '../matterbridge.js';
2
+ const { jest } = await import('@jest/globals');
3
3
  export const addBridgedEndpointMatterbridgeSpy = jest.spyOn(Matterbridge.prototype, 'addBridgedEndpoint');
4
4
  export const removeBridgedEndpointMatterbridgeSpy = jest.spyOn(Matterbridge.prototype, 'removeBridgedEndpoint');
5
5
  export const removeAllBridgedEndpointsMatterbridgeSpy = jest.spyOn(Matterbridge.prototype, 'removeAllBridgedEndpoints');
@@ -1,5 +1,5 @@
1
- import { type Endpoint, type ServerNode } from '@matter/node';
2
- import { type AggregatorEndpoint } from '@matter/node/endpoints';
1
+ import type { Endpoint, ServerNode } from '@matter/node';
2
+ import type { AggregatorEndpoint } from '@matter/node/endpoints';
3
3
  import type { DeviceManager } from '../deviceManager.js';
4
4
  import type { Frontend } from '../frontend.js';
5
5
  import { Matterbridge } from '../matterbridge.js';
@@ -156,7 +156,7 @@ export async function startMatterbridgeEnvironment(port = 5540, createOnly = fal
156
156
  }
157
157
  expect(server.lifecycle.isOnline).toBeFalsy();
158
158
  await new Promise((resolve, reject) => {
159
- server.lifecycle.online.on(async () => {
159
+ server.lifecycle.online.on(() => {
160
160
  resolve();
161
161
  });
162
162
  server.start().catch((err) => reject(err));
@@ -1,47 +1,40 @@
1
- export declare const destroyPluginSpy: import("jest-mock").SpiedFunction<() => void>;
2
- export declare const checkDependenciesPluginSpy: import("jest-mock").SpiedFunction<(packageJson: Record<string, unknown> & {
3
- name?: string;
4
- dependencies?: string[] | Record<string, string>;
5
- devDependencies?: string[] | Record<string, string>;
6
- peerDependencies?: string[] | Record<string, string>;
7
- optionalDependencies?: string[] | Record<string, string>;
8
- bundledDependencies?: string[] | Record<string, string>;
9
- bundleDependencies?: string[] | Record<string, string>;
10
- }) => boolean>;
11
- export declare const lengthPluginSpy: import("jest-mock").SpiedGetter<number>;
12
- export declare const sizePluginSpy: import("jest-mock").SpiedGetter<number>;
13
- export declare const hasPluginSpy: import("jest-mock").SpiedFunction<(name: string) => boolean>;
14
- export declare const getPluginSpy: import("jest-mock").SpiedFunction<(name: string) => import("../pluginManager.js").Plugin | undefined>;
15
- export declare const setPluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin) => import("../pluginManager.js").Plugin>;
16
- export declare const clearPluginSpy: import("jest-mock").SpiedFunction<() => void>;
17
- export declare const arrayPluginSpy: import("jest-mock").SpiedFunction<() => import("../pluginManager.js").Plugin[]>;
18
- export declare const storagePluginArraySpy: import("jest-mock").SpiedFunction<() => import("@matterbridge/types").StoragePlugin[]>;
19
- export declare const apiPluginArraySpy: import("jest-mock").SpiedFunction<() => import("@matterbridge/types").ApiPlugin[]>;
20
- export declare const iteratorPluginSpy: import("jest-mock").SpiedFunction<() => MapIterator<import("../pluginManager.js").Plugin>>;
21
- export declare const forEachPluginSpy: import("jest-mock").SpiedFunction<(callback: (plugin: import("../pluginManager.js").Plugin) => Promise<void>) => Promise<void>>;
22
- export declare const logLevelPluginSpy: import("jest-mock").SpiedSetter<import("node-ansi-logger").LogLevel>;
23
- export declare const loadFromStoragePluginSpy: import("jest-mock").SpiedFunction<() => Promise<import("@matterbridge/types").StoragePlugin[]>>;
24
- export declare const saveToStoragePluginSpy: import("jest-mock").SpiedFunction<() => Promise<number>>;
25
- export declare const resolvePluginSpy: import("jest-mock").SpiedFunction<(nameOrPath: string) => Promise<string | null>>;
26
- export declare const installPluginSpy: import("jest-mock").SpiedFunction<(packageName: string) => void>;
27
- export declare const uninstallPluginSpy: import("jest-mock").SpiedFunction<(packageName: string) => void>;
28
- export declare const getAuthorPluginSpy: import("jest-mock").SpiedFunction<(packageJson: Record<string, string | number | Record<string, string | number | object>>) => string>;
29
- export declare const getDescriptionPluginSpy: import("jest-mock").SpiedFunction<(packageJson: Record<string, string | number | Record<string, string | number | object>>) => string>;
30
- export declare const getHomepagePluginSpy: import("jest-mock").SpiedFunction<(packageJson: Record<string, string | number | Record<string, string | number | object>>) => string | undefined>;
31
- export declare const getHelpPluginSpy: import("jest-mock").SpiedFunction<(packageJson: Record<string, string | number | Record<string, string | number | object>>) => string | undefined>;
32
- export declare const getChangelogPluginSpy: import("jest-mock").SpiedFunction<(packageJson: Record<string, string | number | Record<string, string | number | object>>) => string | undefined>;
33
- export declare const getFundingPluginSpy: import("jest-mock").SpiedFunction<(packageJson: Record<string, any>) => string | undefined>;
34
- export declare const parsePluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin | import("@matterbridge/types").PluginName) => Promise<Record<string, string | number | object> | null>>;
35
- export declare const addPluginSpy: import("jest-mock").SpiedFunction<(nameOrPath: string) => Promise<import("../pluginManager.js").Plugin | null>>;
36
- export declare const enablePluginSpy: import("jest-mock").SpiedFunction<(nameOrPath: string) => Promise<import("../pluginManager.js").Plugin | null>>;
37
- export declare const disablePluginSpy: import("jest-mock").SpiedFunction<(nameOrPath: string) => Promise<import("../pluginManager.js").Plugin | null>>;
38
- export declare const removePluginSpy: import("jest-mock").SpiedFunction<(nameOrPath: string) => Promise<import("../pluginManager.js").Plugin | null>>;
39
- export declare const loadPluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin | import("@matterbridge/types").PluginName, start?: boolean, message?: string, configure?: boolean) => Promise<import("../matterbridgePlatform.js").MatterbridgePlatform | undefined>>;
40
- export declare const startPluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin | import("@matterbridge/types").PluginName, message?: string, configure?: boolean) => Promise<import("../pluginManager.js").Plugin | undefined>>;
41
- export declare const configurePluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin | import("@matterbridge/types").PluginName) => Promise<import("../pluginManager.js").Plugin | undefined>>;
42
- export declare const shutdownPluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin | import("@matterbridge/types").PluginName, reason?: string, removeAllDevices?: boolean, force?: boolean) => Promise<import("../pluginManager.js").Plugin | undefined>>;
43
- export declare const loadConfigPluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin) => Promise<import("@matterbridge/types").PlatformConfig>>;
44
- export declare const saveConfigFromPluginPluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin, restartRequired?: boolean) => Promise<void>>;
45
- export declare const saveConfigFromJsonPluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin, config: import("@matterbridge/types").PlatformConfig, restartRequired?: boolean) => Promise<void>>;
46
- export declare const loadSchemaPluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin) => Promise<import("@matterbridge/types").PlatformSchema>>;
47
- export declare const getDefaultSchemaPluginSpy: import("jest-mock").SpiedFunction<(plugin: import("../pluginManager.js").Plugin) => import("@matterbridge/types").PlatformSchema>;
1
+ import { PluginManager } from '../pluginManager.js';
2
+ export declare const destroyPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.destroy>;
3
+ export declare const checkDependenciesPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.checkDependencies>;
4
+ export declare const lengthPluginSpy: jest.SpiedGetter<typeof PluginManager.prototype.length>;
5
+ export declare const sizePluginSpy: jest.SpiedGetter<typeof PluginManager.prototype.size>;
6
+ export declare const hasPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.has>;
7
+ export declare const getPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.get>;
8
+ export declare const setPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.set>;
9
+ export declare const clearPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.clear>;
10
+ export declare const arrayPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.array>;
11
+ export declare const storagePluginArraySpy: jest.SpiedFunction<typeof PluginManager.prototype.storagePluginArray>;
12
+ export declare const apiPluginArraySpy: jest.SpiedFunction<typeof PluginManager.prototype.apiPluginArray>;
13
+ export declare const iteratorPluginSpy: jest.SpiedFunction<(typeof PluginManager.prototype)[typeof Symbol.iterator]>;
14
+ export declare const forEachPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.forEach>;
15
+ export declare const logLevelPluginSpy: jest.SpiedSetter<typeof PluginManager.prototype.logLevel>;
16
+ export declare const loadFromStoragePluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.loadFromStorage>;
17
+ export declare const saveToStoragePluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.saveToStorage>;
18
+ export declare const resolvePluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.resolve>;
19
+ export declare const installPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.install>;
20
+ export declare const uninstallPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.uninstall>;
21
+ export declare const getAuthorPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.getAuthor>;
22
+ export declare const getDescriptionPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.getDescription>;
23
+ export declare const getHomepagePluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.getHomepage>;
24
+ export declare const getHelpPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.getHelp>;
25
+ export declare const getChangelogPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.getChangelog>;
26
+ export declare const getFundingPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.getFunding>;
27
+ export declare const parsePluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.parse>;
28
+ export declare const addPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.add>;
29
+ export declare const enablePluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.enable>;
30
+ export declare const disablePluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.disable>;
31
+ export declare const removePluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.remove>;
32
+ export declare const loadPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.load>;
33
+ export declare const startPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.start>;
34
+ export declare const configurePluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.configure>;
35
+ export declare const shutdownPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.shutdown>;
36
+ export declare const loadConfigPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.loadConfig>;
37
+ export declare const saveConfigFromPluginPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.saveConfigFromPlugin>;
38
+ export declare const saveConfigFromJsonPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.saveConfigFromJson>;
39
+ export declare const loadSchemaPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.loadSchema>;
40
+ export declare const getDefaultSchemaPluginSpy: jest.SpiedFunction<typeof PluginManager.prototype.getDefaultSchema>;
@@ -1,5 +1,5 @@
1
- import { jest } from '@jest/globals';
2
1
  import { PluginManager } from '../pluginManager.js';
2
+ const { jest } = await import('@jest/globals');
3
3
  export const destroyPluginSpy = jest.spyOn(PluginManager.prototype, 'destroy');
4
4
  export const checkDependenciesPluginSpy = jest.spyOn(PluginManager.prototype, 'checkDependencies');
5
5
  export const lengthPluginSpy = jest.spyOn(PluginManager.prototype, 'length', 'get');
@@ -1,4 +1,3 @@
1
- import type { jest } from '@jest/globals';
2
1
  import { AnsiLogger } from 'node-ansi-logger';
3
2
  export declare const originalProcessArgv: readonly string[];
4
3
  export declare const originalProcessEnv: Readonly<Record<string, string | undefined>>;
@@ -15,6 +15,7 @@ export let consoleDebugSpy;
15
15
  export let consoleInfoSpy;
16
16
  export let consoleWarnSpy;
17
17
  export let consoleErrorSpy;
18
+ const noop = () => undefined;
18
19
  export let NAME;
19
20
  export let HOMEDIR;
20
21
  export let log;
@@ -43,12 +44,12 @@ export async function setupTest(name, debug = false) {
43
44
  consoleErrorSpy = jest.spyOn(console, 'error');
44
45
  }
45
46
  else {
46
- loggerLogSpy = jest.spyOn(AnsiLogger.prototype, 'log').mockImplementation(() => { });
47
- consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(() => { });
48
- consoleDebugSpy = jest.spyOn(console, 'debug').mockImplementation(() => { });
49
- consoleInfoSpy = jest.spyOn(console, 'info').mockImplementation(() => { });
50
- consoleWarnSpy = jest.spyOn(console, 'warn').mockImplementation(() => { });
51
- consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(() => { });
47
+ loggerLogSpy = jest.spyOn(AnsiLogger.prototype, 'log').mockImplementation(noop);
48
+ consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(noop);
49
+ consoleDebugSpy = jest.spyOn(console, 'debug').mockImplementation(noop);
50
+ consoleInfoSpy = jest.spyOn(console, 'info').mockImplementation(noop);
51
+ consoleWarnSpy = jest.spyOn(console, 'warn').mockImplementation(noop);
52
+ consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(noop);
52
53
  }
53
54
  }
54
55
  export async function setDebug(debug) {
@@ -68,11 +69,11 @@ export async function setDebug(debug) {
68
69
  consoleErrorSpy = jest.spyOn(console, 'error');
69
70
  }
70
71
  else {
71
- loggerLogSpy = jest.spyOn(AnsiLogger.prototype, 'log').mockImplementation(() => { });
72
- consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(() => { });
73
- consoleDebugSpy = jest.spyOn(console, 'debug').mockImplementation(() => { });
74
- consoleInfoSpy = jest.spyOn(console, 'info').mockImplementation(() => { });
75
- consoleWarnSpy = jest.spyOn(console, 'warn').mockImplementation(() => { });
76
- consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(() => { });
72
+ loggerLogSpy = jest.spyOn(AnsiLogger.prototype, 'log').mockImplementation(noop);
73
+ consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(noop);
74
+ consoleDebugSpy = jest.spyOn(console, 'debug').mockImplementation(noop);
75
+ consoleInfoSpy = jest.spyOn(console, 'info').mockImplementation(noop);
76
+ consoleWarnSpy = jest.spyOn(console, 'warn').mockImplementation(noop);
77
+ consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(noop);
77
78
  }
78
79
  }
@@ -1,5 +1,5 @@
1
1
  import { ColorControl } from '@matter/types/clusters/color-control';
2
- import { type LevelControl } from '@matter/types/clusters/level-control';
2
+ import type { LevelControl } from '@matter/types/clusters/level-control';
3
3
  export declare function getMoveToLevelRequest(level: number, transitionTime: number, executeIfOff: boolean): LevelControl.MoveToLevelRequest;
4
4
  export declare function getMoveToColorTemperatureRequest(colorTemperatureMireds: number, transitionTime: number, executeIfOff: boolean): ColorControl.MoveToColorTemperatureRequest;
5
5
  export declare function getMoveToHueRequest(hue: number, transitionTime: number, executeIfOff: boolean): ColorControl.MoveToHueRequest;
@@ -14,6 +14,7 @@ import { dev, MATTER_LOGGER_FILE, MATTER_STORAGE_DIR, MATTERBRIDGE_LOGGER_FILE,
14
14
  import { getIntParameter, getParameter, hasParameter } from '@matterbridge/utils/cli';
15
15
  import { copyDirectory } from '@matterbridge/utils/copy-dir';
16
16
  import { getErrorMessage, inspectError } from '@matterbridge/utils/error';
17
+ import { logModuleLoaded } from '@matterbridge/utils/loader';
17
18
  import { isValidNumber, isValidString, parseVersionString } from '@matterbridge/utils/validate';
18
19
  import { wait, withTimeout } from '@matterbridge/utils/wait';
19
20
  import { AnsiLogger, BLUE, CYAN, db, debugStringify, er, nf, or, zb } from 'node-ansi-logger';
@@ -22,6 +23,7 @@ import { toBaseDevice } from './deviceManager.js';
22
23
  import { addVirtualDevice } from './helpers.js';
23
24
  import { bridge } from './matterbridgeDeviceTypes.js';
24
25
  import { PluginManager } from './pluginManager.js';
26
+ logModuleLoaded('MatterNode');
25
27
  export class MatterNode extends EventEmitter {
26
28
  matterbridge;
27
29
  pluginName;
@@ -432,7 +434,7 @@ export class MatterNode extends EventEmitter {
432
434
  this.server.request({ type: 'frontend_refreshrequired', src: 'matter', dst: 'frontend', params: { changed: 'matter', matter: { ...this.getServerNodeData(serverNode) } } });
433
435
  this.server.request({ type: 'frontend_snackbarmessage', src: 'matter', dst: 'frontend', params: { message: `${storeId} is offline`, timeout: 5, severity: 'warning' } });
434
436
  });
435
- serverNode.lifecycle.online.on(async () => {
437
+ serverNode.lifecycle.online.on(() => {
436
438
  this.log.notice(`Server node for ${storeId} is online`);
437
439
  if (!serverNode.lifecycle.isCommissioned) {
438
440
  this.log.notice(`Server node for ${storeId} is not commissioned. Pair to commission ...`);
@@ -634,7 +636,7 @@ export class MatterNode extends EventEmitter {
634
636
  }
635
637
  catch (error) {
636
638
  inspectError(this.log, `Error creating MatterNode for device ${plg}${pluginName}${er}:${dev}${device.deviceName}${er} (${zb}${device.name}${er})`, error);
637
- return;
639
+ return undefined;
638
640
  }
639
641
  }
640
642
  else if (this.matterbridge.bridgeMode === 'bridge') {
@@ -647,7 +649,7 @@ export class MatterNode extends EventEmitter {
647
649
  }
648
650
  catch (error) {
649
651
  inspectError(this.log, `Matter error adding matter endpoint ${plg}${pluginName}${er}:${dev}${device.deviceName}${er} (${zb}${device.name}${er})`, error);
650
- return;
652
+ return undefined;
651
653
  }
652
654
  }
653
655
  else {
@@ -659,7 +661,7 @@ export class MatterNode extends EventEmitter {
659
661
  }
660
662
  catch (error) {
661
663
  inspectError(this.log, `Matter error adding bridged endpoint ${plg}${pluginName}${er}:${dev}${device.deviceName}${er} (${zb}${device.name}${er})`, error);
662
- return;
664
+ return undefined;
663
665
  }
664
666
  }
665
667
  }
@@ -676,7 +678,7 @@ export class MatterNode extends EventEmitter {
676
678
  }
677
679
  catch (error) {
678
680
  inspectError(this.log, `Matter error adding accessory endpoint ${plg}${pluginName}${er}:${dev}${device.deviceName}${er} (${zb}${device.name}${er})`, error);
679
- return;
681
+ return undefined;
680
682
  }
681
683
  }
682
684
  if (plugin.type === 'DynamicPlatform') {
@@ -692,7 +694,7 @@ export class MatterNode extends EventEmitter {
692
694
  }
693
695
  catch (error) {
694
696
  inspectError(this.log, `Matter error adding bridged endpoint ${plg}${pluginName}${er}:${dev}${device.deviceName}${er} (${zb}${device.name}${er})`, error);
695
- return;
697
+ return undefined;
696
698
  }
697
699
  }
698
700
  }
@@ -1,5 +1,3 @@
1
- if (process.argv.includes('--loader'))
2
- console.log('\u001B[32m[' + new Date().toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit', fractionalSecondDigits: 3 }) + '] Matterbridge loaded.\u001B[40;0m');
3
1
  import '@matter/nodejs';
4
2
  import EventEmitter from 'node:events';
5
3
  import fs, { unlinkSync } from 'node:fs';
@@ -19,8 +17,9 @@ import { dev, MATTER_LOGGER_FILE, MATTER_STORAGE_DIR, MATTERBRIDGE_LOGGER_FILE,
19
17
  import { getIntParameter, getParameter, hasAnyParameter, hasParameter } from '@matterbridge/utils/cli';
20
18
  import { copyDirectory } from '@matterbridge/utils/copy-dir';
21
19
  import { createDirectory } from '@matterbridge/utils/create-dir';
22
- import { inspectError } from '@matterbridge/utils/error';
20
+ import { inspectError, logError } from '@matterbridge/utils/error';
23
21
  import { formatBytes, formatPercent, formatUptime } from '@matterbridge/utils/format';
22
+ import { logModuleLoaded } from '@matterbridge/utils/loader';
24
23
  import { excludedInterfaceNamePattern } from '@matterbridge/utils/network';
25
24
  import { isValidNumber, isValidObject, isValidString, parseVersionString } from '@matterbridge/utils/validate';
26
25
  import { fireAndForget, wait } from '@matterbridge/utils/wait';
@@ -32,6 +31,7 @@ import { addVirtualDevice, addVirtualDevices } from './helpers.js';
32
31
  import { bridge } from './matterbridgeDeviceTypes.js';
33
32
  import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
34
33
  import { PluginManager } from './pluginManager.js';
34
+ logModuleLoaded('Matterbridge');
35
35
  export class Matterbridge extends EventEmitter {
36
36
  debug = hasParameter('debug') || hasParameter('verbose');
37
37
  verbose = hasParameter('verbose');
@@ -372,7 +372,7 @@ export class Matterbridge extends EventEmitter {
372
372
  this.log.debug('Created node storage backup');
373
373
  }
374
374
  catch (error) {
375
- this.log.error(`Error creating node storage manager and context: ${error instanceof Error ? error.message : error}`);
375
+ logError(this.log, `Error creating node storage manager and context`, error);
376
376
  if (hasParameter('norestore')) {
377
377
  this.log.fatal(`The matterbridge storage is corrupted. Found -norestore parameter: exiting...`);
378
378
  }
@@ -1022,7 +1022,7 @@ export class Matterbridge extends EventEmitter {
1022
1022
  await this.nodeContext?.set('globalModulesDirectory', this.globalModulesDirectory);
1023
1023
  }
1024
1024
  catch (error) {
1025
- this.log.error(`Error getting global node_modules directory: ${error}`);
1025
+ logError(this.log, `Error getting global node_modules directory`, error);
1026
1026
  }
1027
1027
  }
1028
1028
  else {
@@ -1821,7 +1821,7 @@ export class Matterbridge extends EventEmitter {
1821
1821
  this.log.info(`Closed ${matterServerNode.id} server node`);
1822
1822
  }
1823
1823
  catch (error) {
1824
- this.log.error(`Failed to close ${matterServerNode.id} server node: ${error instanceof Error ? error.message : error}`);
1824
+ logError(this.log, `Failed to close ${matterServerNode.id} server node`, error);
1825
1825
  }
1826
1826
  }
1827
1827
  async createAggregatorNode(storageContext) {
@@ -1883,9 +1883,7 @@ export class Matterbridge extends EventEmitter {
1883
1883
  await this.createDeviceServerNode(plugin, device);
1884
1884
  }
1885
1885
  catch (error) {
1886
- const errorMessage = error instanceof Error ? error.message : error;
1887
- const errorInspect = inspect(error, { depth: 10 });
1888
- this.log.error(`Error creating server node for device ${dev}${device.deviceName}${er} (${zb}${device.id}${er}) of plugin ${plg}${pluginName}${er}: ${errorMessage}\nstack: ${errorInspect}`);
1886
+ inspectError(this.log, `Error creating server node for device ${dev}${device.deviceName}${er} (${zb}${device.id}${er}) of plugin ${plg}${pluginName}${er}`, error);
1889
1887
  return;
1890
1888
  }
1891
1889
  }
@@ -1900,9 +1898,7 @@ export class Matterbridge extends EventEmitter {
1900
1898
  await this.serverNode.add(device);
1901
1899
  }
1902
1900
  catch (error) {
1903
- const errorMessage = error instanceof Error ? error.message : error;
1904
- const errorInspect = inspect(error, { depth: 10 });
1905
- this.log.error(`Error adding matter endpoint ${dev}${device.deviceName}${er} (${zb}${device.id}${er}) for plugin ${plg}${pluginName}${er}: ${errorMessage}\nstack: ${errorInspect}`);
1901
+ inspectError(this.log, `Error adding matter endpoint ${dev}${device.deviceName}${er} (${zb}${device.id}${er}) for plugin ${plg}${pluginName}${er}`, error);
1906
1902
  return;
1907
1903
  }
1908
1904
  }
@@ -1916,9 +1912,7 @@ export class Matterbridge extends EventEmitter {
1916
1912
  await this.aggregatorNode.add(device);
1917
1913
  }
1918
1914
  catch (error) {
1919
- const errorMessage = error instanceof Error ? error.message : error;
1920
- const errorInspect = inspect(error, { depth: 10 });
1921
- this.log.error(`Error adding bridged endpoint ${dev}${device.deviceName}${er} (${zb}${device.id}${er}) for plugin ${plg}${pluginName}${er}: ${errorMessage}\nstack: ${errorInspect}`);
1915
+ inspectError(this.log, `Error adding bridged endpoint ${dev}${device.deviceName}${er} (${zb}${device.id}${er}) for plugin ${plg}${pluginName}${er}`, error);
1922
1916
  return;
1923
1917
  }
1924
1918
  }
@@ -1941,9 +1935,7 @@ export class Matterbridge extends EventEmitter {
1941
1935
  }
1942
1936
  }
1943
1937
  catch (error) {
1944
- const errorMessage = error instanceof Error ? error.message : error;
1945
- const errorInspect = inspect(error, { depth: 10 });
1946
- this.log.error(`Error creating endpoint ${dev}${device.deviceName}${er} (${zb}${device.id}${er}) for AccessoryPlatform plugin ${plg}${pluginName}${er} server node: ${errorMessage}\nstack: ${errorInspect}`);
1938
+ inspectError(this.log, `Error creating endpoint ${dev}${device.deviceName}${er} (${zb}${device.id}${er}) for AccessoryPlatform plugin ${plg}${pluginName}${er} server node`, error);
1947
1939
  return;
1948
1940
  }
1949
1941
  }
@@ -1962,9 +1954,7 @@ export class Matterbridge extends EventEmitter {
1962
1954
  await plugin.aggregatorNode.add(device);
1963
1955
  }
1964
1956
  catch (error) {
1965
- const errorMessage = error instanceof Error ? error.message : error;
1966
- const errorInspect = inspect(error, { depth: 10 });
1967
- this.log.error(`Error adding bridged endpoint ${dev}${device.deviceName}${er} (${zb}${device.id}${er}) for DynamicPlatform plugin ${plg}${pluginName}${er} aggregator node: ${errorMessage}\nstack: ${errorInspect}`);
1957
+ inspectError(this.log, `Error adding bridged endpoint ${dev}${device.deviceName}${er} (${zb}${device.id}${er}) for DynamicPlatform plugin ${plg}${pluginName}${er} aggregator node`, error);
1968
1958
  return;
1969
1959
  }
1970
1960
  }
@@ -1,5 +1,5 @@
1
1
  import type { PlatformConfig, PlatformMatterbridge } from '@matterbridge/types';
2
- import { type AnsiLogger } from 'node-ansi-logger';
2
+ import type { AnsiLogger } from 'node-ansi-logger';
3
3
  import { MatterbridgePlatform } from './matterbridgePlatform.js';
4
4
  export declare function isMatterbridgeAccessoryPlatform(value: unknown): value is MatterbridgeAccessoryPlatform;
5
5
  export declare class MatterbridgeAccessoryPlatform extends MatterbridgePlatform {
@@ -1,6 +1,6 @@
1
- if (process.argv.includes('--loader'))
2
- console.log('\u001B[32m[' + new Date().toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit', fractionalSecondDigits: 3 }) + '] MatterbridgeAccessoryPlatform loaded.\u001B[40;0m');
1
+ import { logModuleLoaded } from '@matterbridge/utils/loader';
3
2
  import { MatterbridgePlatform } from './matterbridgePlatform.js';
3
+ logModuleLoaded('MatterbridgeAccessoryPlatform');
4
4
  const MATTERBRIDGE_ACCESSORY_PLATFORM_BRAND = Symbol('MatterbridgeAccessoryPlatform.brand');
5
5
  export function isMatterbridgeAccessoryPlatform(value) {
6
6
  if (!value || typeof value !== 'object')
@@ -1,5 +1,3 @@
1
- if (process.argv.includes('--loader'))
2
- console.log('\u001B[32m[' + new Date().toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit', fractionalSecondDigits: 3 }) + '] MatterbridgeDeviceTypes loaded.\u001B[40;0m');
3
1
  import { AccountLogin } from '@matter/types/clusters/account-login';
4
2
  import { Actions } from '@matter/types/clusters/actions';
5
3
  import { ActivatedCarbonFilterMonitoring } from '@matter/types/clusters/activated-carbon-filter-monitoring';
@@ -109,6 +107,8 @@ import { WebRtcTransportRequestor } from '@matter/types/clusters/web-rtc-transpo
109
107
  import { WindowCovering } from '@matter/types/clusters/window-covering';
110
108
  import { ZoneManagement } from '@matter/types/clusters/zone-management';
111
109
  import { DeviceTypeId } from '@matter/types/datatype';
110
+ import { logModuleLoaded } from '@matterbridge/utils/loader';
111
+ logModuleLoaded('MatterbridgeDeviceTypes');
112
112
  export var DeviceClasses;
113
113
  (function (DeviceClasses) {
114
114
  DeviceClasses["Node"] = "Node";
@@ -1,5 +1,5 @@
1
1
  import type { PlatformConfig, PlatformMatterbridge } from '@matterbridge/types';
2
- import { type AnsiLogger } from 'node-ansi-logger';
2
+ import type { AnsiLogger } from 'node-ansi-logger';
3
3
  import { MatterbridgePlatform } from './matterbridgePlatform.js';
4
4
  export declare function isMatterbridgeDynamicPlatform(value: unknown): value is MatterbridgeDynamicPlatform;
5
5
  export declare class MatterbridgeDynamicPlatform extends MatterbridgePlatform {
@@ -1,6 +1,6 @@
1
- if (process.argv.includes('--loader'))
2
- console.log('\u001B[32m[' + new Date().toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit', fractionalSecondDigits: 3 }) + '] MatterbridgeDynamicPlatform loaded.\u001B[40;0m');
1
+ import { logModuleLoaded } from '@matterbridge/utils/loader';
3
2
  import { MatterbridgePlatform } from './matterbridgePlatform.js';
3
+ logModuleLoaded('MatterbridgeDynamicPlatform');
4
4
  const MATTERBRIDGE_DYNAMIC_PLATFORM_BRAND = Symbol('MatterbridgeDynamicPlatform.brand');
5
5
  export function isMatterbridgeDynamicPlatform(value) {
6
6
  if (!value || typeof value !== 'object')