@matterbridge/core 3.6.2-dev-20260317-e291a17 → 3.7.0-dev-20260318-c9f4120

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.
@@ -20,7 +20,7 @@ import { MeasurementType, Semtag } from '@matter/types/globals';
20
20
  import { AnsiLogger } from 'node-ansi-logger';
21
21
  import { MatterbridgeDeviceEnergyManagementModeServer, MatterbridgeDeviceEnergyManagementServer, MatterbridgeOperationalStateServer, MatterbridgePowerSourceServer } from './matterbridgeBehaviorsServer.js';
22
22
  import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
23
- import { MatterbridgeEndpointCommands } from './matterbridgeEndpointTypes.js';
23
+ import { CommandHandlers } from './matterbridgeEndpointCommandHandler.js';
24
24
  export declare function capitalizeFirstLetter(name: string): string;
25
25
  export declare function lowercaseFirstLetter(name: string): string;
26
26
  export declare function getSnapshot<T>(value: T): T;
@@ -34,7 +34,7 @@ export declare function getBehaviourTypesFromClusterClientIds(clusterClientList:
34
34
  export declare function getBehaviourTypeFromClusterServerId(clusterId: ClusterId): Behavior.Type;
35
35
  export declare function getBehaviourTypeFromClusterClientId(_clusterId: ClusterId): void;
36
36
  export declare function getBehavior(endpoint: MatterbridgeEndpoint, cluster: Behavior.Type | ClusterType | ClusterId | string): Behavior.Type | undefined;
37
- export declare function invokeBehaviorCommand(endpoint: MatterbridgeEndpoint, cluster: Behavior.Type | ClusterType | ClusterId | string, command: keyof MatterbridgeEndpointCommands, params?: Record<string, boolean | number | bigint | string | object | null>): Promise<boolean>;
37
+ export declare function invokeBehaviorCommand(endpoint: MatterbridgeEndpoint, cluster: Behavior.Type | ClusterType | ClusterId | string, command: CommandHandlers, params?: Record<string, boolean | number | bigint | string | object | null>): Promise<boolean>;
38
38
  export declare function invokeSubscribeHandler(endpoint: MatterbridgeEndpoint, cluster: Behavior.Type | ClusterType | ClusterId | string, attribute: string, newValue: unknown, oldValue: unknown): Promise<boolean>;
39
39
  export declare function addRequiredClusterServers(endpoint: MatterbridgeEndpoint): void;
40
40
  export declare function addOptionalClusterServers(endpoint: MatterbridgeEndpoint): void;
@@ -289,6 +289,7 @@ export async function invokeBehaviorCommand(endpoint, cluster, command, params)
289
289
  endpoint.log?.error(`invokeBehaviorCommand error: command ${hk}${command}${er} not found on endpoint ${or}${endpoint.maybeId}${er}:${or}${endpoint.maybeNumber}${er}`);
290
290
  return false;
291
291
  }
292
+ command = command.includes('.') ? command.split('.')[1] : command;
292
293
  let invoked = true;
293
294
  await endpoint.act(async (agent) => {
294
295
  const behavior = agent[behaviorId];
@@ -1,90 +1,7 @@
1
- import { HandlerFunction } from '@matter/general';
2
1
  import { ClusterId, EndpointNumber } from '@matter/types/datatype';
3
2
  import { Semtag } from '@matter/types/globals';
4
3
  import type { DeviceTypeDefinition } from './matterbridgeDeviceTypes.js';
5
- import type { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
6
4
  export type PrimitiveTypes = boolean | number | bigint | string | object | undefined | null;
7
- export type CommandHandlerData = {
8
- request: Record<string, any>;
9
- cluster: string;
10
- attributes: Record<string, PrimitiveTypes>;
11
- endpoint: MatterbridgeEndpoint;
12
- };
13
- export type CommandHandlerFunction = (data: CommandHandlerData) => void | Promise<void>;
14
- export interface MatterbridgeEndpointCommands {
15
- identify: HandlerFunction;
16
- triggerEffect: HandlerFunction;
17
- on: HandlerFunction;
18
- off: HandlerFunction;
19
- toggle: HandlerFunction;
20
- offWithEffect: HandlerFunction;
21
- moveToLevel: HandlerFunction;
22
- moveToLevelWithOnOff: HandlerFunction;
23
- moveToColor: HandlerFunction;
24
- moveColor: HandlerFunction;
25
- stepColor: HandlerFunction;
26
- moveToHue: HandlerFunction;
27
- moveHue: HandlerFunction;
28
- stepHue: HandlerFunction;
29
- enhancedMoveToHue: HandlerFunction;
30
- enhancedMoveHue: HandlerFunction;
31
- enhancedStepHue: HandlerFunction;
32
- moveToSaturation: HandlerFunction;
33
- moveSaturation: HandlerFunction;
34
- stepSaturation: HandlerFunction;
35
- moveToHueAndSaturation: HandlerFunction;
36
- enhancedMoveToHueAndSaturation: HandlerFunction;
37
- moveToColorTemperature: HandlerFunction;
38
- upOrOpen: HandlerFunction;
39
- downOrClose: HandlerFunction;
40
- stopMotion: HandlerFunction;
41
- goToLiftPercentage: HandlerFunction;
42
- goToTiltPercentage: HandlerFunction;
43
- moveTo: HandlerFunction;
44
- setTarget: HandlerFunction;
45
- lockDoor: HandlerFunction;
46
- unlockDoor: HandlerFunction;
47
- setpointRaiseLower: HandlerFunction;
48
- setActivePresetRequest: HandlerFunction;
49
- step: HandlerFunction;
50
- changeToMode: HandlerFunction;
51
- open: HandlerFunction;
52
- close: HandlerFunction;
53
- suppressAlarm: HandlerFunction;
54
- enableDisableAlarm: HandlerFunction;
55
- selfTestRequest: HandlerFunction;
56
- resetCounts: HandlerFunction;
57
- setUtcTime: HandlerFunction;
58
- setTimeZone: HandlerFunction;
59
- setDstOffset: HandlerFunction;
60
- pauseRequest: HandlerFunction;
61
- resumeRequest: HandlerFunction;
62
- pause: HandlerFunction;
63
- stop: HandlerFunction;
64
- start: HandlerFunction;
65
- resume: HandlerFunction;
66
- goHome: HandlerFunction;
67
- selectAreas: HandlerFunction;
68
- boost: HandlerFunction;
69
- cancelBoost: HandlerFunction;
70
- enableCharging: HandlerFunction;
71
- disable: HandlerFunction;
72
- setTargets: HandlerFunction;
73
- getTargets: HandlerFunction;
74
- clearTargets: HandlerFunction;
75
- powerAdjustRequest: HandlerFunction;
76
- cancelPowerAdjustRequest: HandlerFunction;
77
- setTemperature: HandlerFunction;
78
- setCookingParameters: HandlerFunction;
79
- addMoreTime: HandlerFunction;
80
- play: HandlerFunction;
81
- previous: HandlerFunction;
82
- next: HandlerFunction;
83
- skipForward: HandlerFunction;
84
- skipBackward: HandlerFunction;
85
- sendKey: HandlerFunction;
86
- resetCondition: HandlerFunction;
87
- }
88
5
  export interface SerializedMatterbridgeEndpoint {
89
6
  pluginName: string;
90
7
  deviceName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matterbridge/core",
3
- "version": "3.6.2-dev-20260317-e291a17",
3
+ "version": "3.7.0-dev-20260318-c9f4120",
4
4
  "description": "Matterbridge core library",
5
5
  "author": "https://github.com/Luligu",
6
6
  "homepage": "https://matterbridge.io/",
@@ -122,10 +122,10 @@
122
122
  ],
123
123
  "dependencies": {
124
124
  "@matter/main": "0.16.10",
125
- "@matterbridge/dgram": "3.6.2-dev-20260317-e291a17",
126
- "@matterbridge/thread": "3.6.2-dev-20260317-e291a17",
127
- "@matterbridge/types": "3.6.2-dev-20260317-e291a17",
128
- "@matterbridge/utils": "3.6.2-dev-20260317-e291a17",
125
+ "@matterbridge/dgram": "3.7.0-dev-20260318-c9f4120",
126
+ "@matterbridge/thread": "3.7.0-dev-20260318-c9f4120",
127
+ "@matterbridge/types": "3.7.0-dev-20260318-c9f4120",
128
+ "@matterbridge/utils": "3.7.0-dev-20260318-c9f4120",
129
129
  "express": "5.2.1",
130
130
  "multer": "2.1.1",
131
131
  "node-ansi-logger": "3.2.0",