@matterbridge/core 3.6.0-dev-20260304-2f99eca → 3.6.0-dev-20260304-df69d06
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.
- package/dist/devices/closure.d.ts +153 -14
- package/dist/devices/closure.js +9 -4
- package/dist/devices/closurePanel.d.ts +193 -14
- package/dist/devices/closurePanel.js +9 -4
- package/dist/devices/irrigationSystem.d.ts +2 -0
- package/dist/devices/irrigationSystem.js +8 -1
- package/dist/devices/microwaveOven.d.ts +2 -2
- package/dist/devices/microwaveOven.js +6 -5
- package/dist/devices/soilSensor.d.ts +15 -3
- package/dist/devices/soilSensor.js +20 -5
- package/dist/matterbridgeBehaviors.d.ts +2 -2
- package/dist/matterbridgeBehaviors.js +7 -6
- package/dist/matterbridgeEndpointHelpers.js +9 -5
- package/package.json +5 -5
- package/dist/devices/customClusterSchema.d.ts +0 -22
- package/dist/devices/customClusterSchema.js +0 -53
|
@@ -1,11 +1,154 @@
|
|
|
1
1
|
import { MaybePromise } from '@matter/general';
|
|
2
2
|
import { ClusterBehavior } from '@matter/node';
|
|
3
|
+
import { ClusterType } from '@matter/types';
|
|
3
4
|
import { ClosureControl } from '../clusters/closure-control.js';
|
|
4
5
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
5
|
-
export
|
|
6
|
-
|
|
6
|
+
export declare namespace ClosureControlServer {
|
|
7
|
+
interface State {
|
|
8
|
+
mainState: ClosureControl.MainState;
|
|
9
|
+
currentErrorList: ClosureControl.ClosureError[];
|
|
10
|
+
overallCurrentState: ClosureControl.OverallCurrentState | null;
|
|
11
|
+
overallTargetState: ClosureControl.OverallTargetState | null;
|
|
12
|
+
countdownTime: number | null;
|
|
13
|
+
}
|
|
7
14
|
}
|
|
8
|
-
declare const
|
|
15
|
+
declare const ClosureControlServer_base: ClusterBehavior.Type<import("@matter/types").ClusterComposer.WithFeatures<ClusterType.Of<{
|
|
16
|
+
readonly id: 260;
|
|
17
|
+
readonly name: "ClosureControl";
|
|
18
|
+
readonly revision: 1;
|
|
19
|
+
readonly features: {
|
|
20
|
+
readonly positioning: import("@matter/types").BitFlag;
|
|
21
|
+
readonly motionLatching: import("@matter/types").BitFlag;
|
|
22
|
+
readonly instantaneous: import("@matter/types").BitFlag;
|
|
23
|
+
readonly speed: import("@matter/types").BitFlag;
|
|
24
|
+
readonly ventilation: import("@matter/types").BitFlag;
|
|
25
|
+
readonly pedestrian: import("@matter/types").BitFlag;
|
|
26
|
+
readonly calibration: import("@matter/types").BitFlag;
|
|
27
|
+
readonly protection: import("@matter/types").BitFlag;
|
|
28
|
+
readonly manuallyOperable: import("@matter/types").BitFlag;
|
|
29
|
+
};
|
|
30
|
+
readonly attributes: {
|
|
31
|
+
readonly mainState: import("@matter/types").Attribute<ClosureControl.MainState, any>;
|
|
32
|
+
readonly currentErrorList: import("@matter/types").Attribute<ClosureControl.ClosureError[], any>;
|
|
33
|
+
readonly overallCurrentState: import("@matter/types").Attribute<import("@matter/types").TypeFromFields<{
|
|
34
|
+
position: import("@matter/types").OptionalFieldType<ClosureControl.CurrentPosition | null>;
|
|
35
|
+
latch: import("@matter/types").OptionalFieldType<boolean | null>;
|
|
36
|
+
speed: import("@matter/types").OptionalFieldType<import("@matter/types").ThreeLevelAuto>;
|
|
37
|
+
secureState: import("@matter/types").OptionalFieldType<boolean | null>;
|
|
38
|
+
}> | null, any>;
|
|
39
|
+
readonly overallTargetState: import("@matter/types").Attribute<import("@matter/types").TypeFromFields<{
|
|
40
|
+
position: import("@matter/types").OptionalFieldType<ClosureControl.TargetPosition | null>;
|
|
41
|
+
latch: import("@matter/types").OptionalFieldType<boolean | null>;
|
|
42
|
+
speed: import("@matter/types").OptionalFieldType<import("@matter/types").ThreeLevelAuto>;
|
|
43
|
+
}> | null, any>;
|
|
44
|
+
};
|
|
45
|
+
readonly commands: {
|
|
46
|
+
readonly moveTo: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
|
|
47
|
+
position: import("@matter/types").OptionalFieldType<ClosureControl.TargetPosition>;
|
|
48
|
+
latch: import("@matter/types").OptionalFieldType<boolean>;
|
|
49
|
+
speed: import("@matter/types").OptionalFieldType<import("@matter/types").ThreeLevelAuto>;
|
|
50
|
+
}>, void, any>;
|
|
51
|
+
};
|
|
52
|
+
readonly events: {
|
|
53
|
+
readonly operationalError: import("@matter/types").Event<import("@matter/types").TypeFromFields<{
|
|
54
|
+
errorState: import("@matter/types").FieldType<ClosureControl.ClosureError[]>;
|
|
55
|
+
}>, any>;
|
|
56
|
+
readonly secureStateChanged: import("@matter/types").Event<import("@matter/types").TypeFromFields<{
|
|
57
|
+
secureValue: import("@matter/types").FieldType<boolean>;
|
|
58
|
+
}>, any>;
|
|
59
|
+
};
|
|
60
|
+
readonly extensions: readonly [{
|
|
61
|
+
readonly flags: {
|
|
62
|
+
readonly instantaneous: false;
|
|
63
|
+
};
|
|
64
|
+
readonly component: {
|
|
65
|
+
readonly commands: {
|
|
66
|
+
readonly stop: import("@matter/types").Command<void, void, any>;
|
|
67
|
+
};
|
|
68
|
+
readonly events: {
|
|
69
|
+
readonly movementCompleted: import("@matter/types").Event<void, any>;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}, {
|
|
73
|
+
readonly flags: {
|
|
74
|
+
readonly motionLatching: true;
|
|
75
|
+
};
|
|
76
|
+
readonly component: {
|
|
77
|
+
readonly attributes: {
|
|
78
|
+
readonly latchControlModes: import("@matter/types").FixedAttribute<import("@matter/types").TypeFromPartialBitSchema<{
|
|
79
|
+
remoteLatching: import("@matter/types").BitFlag;
|
|
80
|
+
remoteUnlatching: import("@matter/types").BitFlag;
|
|
81
|
+
}>, any>;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}, {
|
|
85
|
+
readonly flags: {
|
|
86
|
+
readonly calibration: true;
|
|
87
|
+
};
|
|
88
|
+
readonly component: {
|
|
89
|
+
readonly commands: {
|
|
90
|
+
readonly calibrate: import("@matter/types").Command<void, void, any>;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}, {
|
|
94
|
+
readonly flags: {
|
|
95
|
+
readonly manuallyOperable: true;
|
|
96
|
+
};
|
|
97
|
+
readonly component: {
|
|
98
|
+
readonly events: {
|
|
99
|
+
readonly engageStateChanged: import("@matter/types").Event<import("@matter/types").TypeFromFields<{
|
|
100
|
+
engageValue: import("@matter/types").FieldType<boolean>;
|
|
101
|
+
}>, any>;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
}, {
|
|
105
|
+
readonly flags: {
|
|
106
|
+
readonly positioning: true;
|
|
107
|
+
readonly instantaneous: false;
|
|
108
|
+
};
|
|
109
|
+
readonly component: {
|
|
110
|
+
readonly attributes: {
|
|
111
|
+
readonly countdownTime: import("@matter/types").Attribute<number | null, any>;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
}, {
|
|
115
|
+
readonly flags: {
|
|
116
|
+
readonly positioning: false;
|
|
117
|
+
readonly motionLatching: false;
|
|
118
|
+
};
|
|
119
|
+
readonly component: false;
|
|
120
|
+
}, {
|
|
121
|
+
readonly flags: {
|
|
122
|
+
readonly speed: true;
|
|
123
|
+
readonly positioning: false;
|
|
124
|
+
};
|
|
125
|
+
readonly component: false;
|
|
126
|
+
}, {
|
|
127
|
+
readonly flags: {
|
|
128
|
+
readonly speed: true;
|
|
129
|
+
readonly instantaneous: true;
|
|
130
|
+
};
|
|
131
|
+
readonly component: false;
|
|
132
|
+
}, {
|
|
133
|
+
readonly flags: {
|
|
134
|
+
readonly ventilation: true;
|
|
135
|
+
readonly positioning: false;
|
|
136
|
+
};
|
|
137
|
+
readonly component: false;
|
|
138
|
+
}, {
|
|
139
|
+
readonly flags: {
|
|
140
|
+
readonly pedestrian: true;
|
|
141
|
+
readonly positioning: false;
|
|
142
|
+
};
|
|
143
|
+
readonly component: false;
|
|
144
|
+
}, {
|
|
145
|
+
readonly flags: {
|
|
146
|
+
readonly calibration: true;
|
|
147
|
+
readonly positioning: false;
|
|
148
|
+
};
|
|
149
|
+
readonly component: false;
|
|
150
|
+
}];
|
|
151
|
+
}>, readonly [ClosureControl.Feature.Positioning]>, ClusterBehavior.Type<ClusterType.Of<{
|
|
9
152
|
readonly id: 260;
|
|
10
153
|
readonly name: "ClosureControl";
|
|
11
154
|
readonly revision: 1;
|
|
@@ -141,23 +284,19 @@ declare const ClosureControlServerBase: ClusterBehavior.Type<import("@matter/typ
|
|
|
141
284
|
};
|
|
142
285
|
readonly component: false;
|
|
143
286
|
}];
|
|
144
|
-
}>,
|
|
287
|
+
}>, typeof ClusterBehavior, {
|
|
288
|
+
components: never[];
|
|
289
|
+
}>, {
|
|
145
290
|
components: never[];
|
|
146
291
|
}>;
|
|
147
|
-
export declare
|
|
148
|
-
interface State {
|
|
149
|
-
mainState: ClosureControl.MainState;
|
|
150
|
-
currentErrorList: ClosureControl.ClosureError[];
|
|
151
|
-
overallCurrentState: ClosureControl.OverallCurrentState | null;
|
|
152
|
-
overallTargetState: ClosureControl.OverallTargetState | null;
|
|
153
|
-
countdownTime: number | null;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
export declare class ClosureControlServer extends ClosureControlServerBase {
|
|
292
|
+
export declare class ClosureControlServer extends ClosureControlServer_base {
|
|
157
293
|
state: ClosureControlServer.State;
|
|
158
294
|
moveTo: (request: ClosureControl.MoveToRequest) => MaybePromise;
|
|
159
295
|
stop: () => MaybePromise;
|
|
160
296
|
}
|
|
297
|
+
export interface ClosureOptions {
|
|
298
|
+
mainState?: ClosureControl.MainState;
|
|
299
|
+
}
|
|
161
300
|
export declare class Closure extends MatterbridgeEndpoint {
|
|
162
301
|
constructor(name: string, serial: string, options?: ClosureOptions);
|
|
163
302
|
getMainState(): ClosureControl.MainState;
|
package/dist/devices/closure.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { AttributeElement, ClusterElement, ClusterModel, CommandElement, DatatypeElement, EventElement, FieldElement } from '@matter/main/model';
|
|
1
2
|
import { ClusterBehavior } from '@matter/node';
|
|
3
|
+
import { ClusterType } from '@matter/types';
|
|
2
4
|
import { ClosureControl } from '../clusters/closure-control.js';
|
|
3
5
|
import { MatterbridgeServer } from '../matterbridgeBehaviors.js';
|
|
4
6
|
import { closure } from '../matterbridgeDeviceTypes.js';
|
|
5
7
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const ClosureControlSchema = ClusterElement({
|
|
9
|
+
id: ClosureControl.Cluster.id,
|
|
10
|
+
name: ClosureControl.Cluster.name,
|
|
11
|
+
classification: 'application',
|
|
12
|
+
}, AttributeElement({ id: 0xfffd, name: 'ClusterRevision', type: 'ClusterRevision', conformance: 'M', default: ClosureControl.Base.revision ?? 1 }), AttributeElement({ id: 0xfffc, name: 'FeatureMap', type: 'FeatureMap', conformance: 'M' }, FieldElement({ name: 'POS', constraint: '0', title: 'Positioning' }), FieldElement({ name: 'ML', constraint: '1', title: 'MotionLatching' }), FieldElement({ name: 'INS', constraint: '2', title: 'Instantaneous' }), FieldElement({ name: 'SPD', constraint: '3', title: 'Speed' }), FieldElement({ name: 'VNT', constraint: '4', title: 'Ventilation' }), FieldElement({ name: 'PED', constraint: '5', title: 'Pedestrian' }), FieldElement({ name: 'CAL', constraint: '6', title: 'Calibration' }), FieldElement({ name: 'PRT', constraint: '7', title: 'Protection' }), FieldElement({ name: 'MAN', constraint: '8', title: 'ManuallyOperable' })), AttributeElement({ name: 'CountdownTime', id: 0x0000, type: 'uint32', conformance: 'POS', default: null, quality: 'X' }), AttributeElement({ name: 'MainState', id: 0x0001, type: 'MainStateEnum', conformance: 'M', constraint: 'desc' }), AttributeElement({ name: 'CurrentErrorList', id: 0x0002, type: 'list', conformance: 'M', default: [] }, FieldElement({ name: 'entry', type: 'ClosureErrorEnum' })), AttributeElement({ name: 'OverallCurrentState', id: 0x0003, type: 'OverallCurrentStateStruct', conformance: 'M', default: null, quality: 'X' }), AttributeElement({ name: 'OverallTargetState', id: 0x0004, type: 'OverallTargetStateStruct', conformance: 'M', default: null, quality: 'X' }), CommandElement({ name: 'Stop', id: 0x0000, conformance: 'M', direction: 'request', response: 'status' }), CommandElement({ name: 'MoveTo', id: 0x0001, conformance: 'M', direction: 'request', response: 'status' }, FieldElement({ name: 'Position', id: 0, type: 'TargetPositionEnum', conformance: 'O' }), FieldElement({ name: 'Latch', id: 1, type: 'bool', conformance: 'O' }), FieldElement({ name: 'Speed', id: 2, type: 'ThreeLevelAutoEnum', conformance: 'O' })), EventElement({ name: 'OperationalError', id: 0x0000, conformance: 'M', priority: 'critical' }, FieldElement({ name: 'ErrorState', id: 0, type: 'list', conformance: 'M', constraint: 'max 10' }, FieldElement({ name: 'entry', type: 'ClosureErrorEnum' }))), EventElement({ name: 'MovementCompleted', id: 0x0001, conformance: 'M', priority: 'info' }), EventElement({ name: 'SecureStateChanged', id: 0x0003, conformance: 'M', priority: 'info' }, FieldElement({ name: 'SecureValue', id: 0, type: 'bool', conformance: 'M' })), DatatypeElement({ name: 'ClosureErrorEnum', type: 'enum8' }, FieldElement({ name: 'PhysicallyBlocked', id: 0, conformance: 'M' }), FieldElement({ name: 'BlockedBySensor', id: 1, conformance: 'M' }), FieldElement({ name: 'TemperatureLimited', id: 2, conformance: 'M' }), FieldElement({ name: 'MaintenanceRequired', id: 3, conformance: 'M' }), FieldElement({ name: 'InternalInterference', id: 4, conformance: 'M' })), DatatypeElement({ name: 'CurrentPositionEnum', type: 'enum8' }, FieldElement({ name: 'FullyClosed', id: 0, conformance: 'M' }), FieldElement({ name: 'FullyOpened', id: 1, conformance: 'M' }), FieldElement({ name: 'PartiallyOpened', id: 2, conformance: 'M' }), FieldElement({ name: 'OpenedForPedestrian', id: 3, conformance: 'M' }), FieldElement({ name: 'OpenedForVentilation', id: 4, conformance: 'M' }), FieldElement({ name: 'OpenedAtSignature', id: 5, conformance: 'M' })), DatatypeElement({ name: 'MainStateEnum', type: 'enum8' }, FieldElement({ name: 'Stopped', id: 0, conformance: 'M' }), FieldElement({ name: 'Moving', id: 1, conformance: 'M' }), FieldElement({ name: 'WaitingForMotion', id: 2, conformance: 'M' }), FieldElement({ name: 'Error', id: 3, conformance: 'M' }), FieldElement({ name: 'Calibrating', id: 4, conformance: 'M' }), FieldElement({ name: 'Protected', id: 5, conformance: 'M' }), FieldElement({ name: 'Disengaged', id: 6, conformance: 'M' }), FieldElement({ name: 'SetupRequired', id: 7, conformance: 'M' })), DatatypeElement({ name: 'TargetPositionEnum', type: 'enum8' }, FieldElement({ name: 'MoveToFullyClosed', id: 0, conformance: 'M' }), FieldElement({ name: 'MoveToFullyOpen', id: 1, conformance: 'M' }), FieldElement({ name: 'MoveToPedestrianPosition', id: 2, conformance: 'M' }), FieldElement({ name: 'MoveToVentilationPosition', id: 3, conformance: 'M' }), FieldElement({ name: 'MoveToSignaturePosition', id: 4, conformance: 'M' })), DatatypeElement({ name: 'OverallCurrentStateStruct', type: 'struct' }, FieldElement({ name: 'Position', id: 0, type: 'CurrentPositionEnum', conformance: 'O', default: null, quality: 'X' }), FieldElement({ name: 'Latch', id: 1, type: 'bool', conformance: 'O', default: null, quality: 'X' }), FieldElement({ name: 'Speed', id: 2, type: 'ThreeLevelAutoEnum', conformance: 'O' }), FieldElement({ name: 'SecureState', id: 3, type: 'bool', conformance: 'O', default: null, quality: 'X' })), DatatypeElement({ name: 'OverallTargetStateStruct', type: 'struct' }, FieldElement({ name: 'Position', id: 0, type: 'TargetPositionEnum', conformance: 'O', default: null, quality: 'X' }), FieldElement({ name: 'Latch', id: 1, type: 'bool', conformance: 'O', default: null, quality: 'X' }), FieldElement({ name: 'Speed', id: 2, type: 'ThreeLevelAutoEnum', conformance: 'O' })));
|
|
13
|
+
const ClosureControlBehavior = ClusterBehavior.for(ClusterType(ClosureControl.Base), new ClusterModel(ClosureControlSchema));
|
|
14
|
+
export class ClosureControlServer extends ClosureControlBehavior.with(ClosureControl.Feature.Positioning) {
|
|
10
15
|
moveTo = (request) => {
|
|
11
16
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
12
17
|
device.log.info(`MoveTo (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
@@ -1,12 +1,193 @@
|
|
|
1
1
|
import { MaybePromise } from '@matter/general';
|
|
2
2
|
import { ClusterBehavior } from '@matter/node';
|
|
3
|
+
import { ClusterType } from '@matter/types';
|
|
3
4
|
import { ClosureDimension } from '../clusters/closure-dimension.js';
|
|
4
5
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
export declare namespace ClosureDimensionServer {
|
|
7
|
+
interface State {
|
|
8
|
+
currentState: ClosureDimension.DimensionState | null;
|
|
9
|
+
targetState: ClosureDimension.DimensionState | null;
|
|
10
|
+
resolution: number;
|
|
11
|
+
stepValue: number;
|
|
12
|
+
}
|
|
8
13
|
}
|
|
9
|
-
declare const
|
|
14
|
+
declare const ClosureDimensionServer_base: ClusterBehavior.Type<import("@matter/types").ClusterComposer.WithFeatures<ClusterType.Of<{
|
|
15
|
+
readonly id: 261;
|
|
16
|
+
readonly name: "ClosureDimension";
|
|
17
|
+
readonly revision: 1;
|
|
18
|
+
readonly features: {
|
|
19
|
+
readonly positioning: import("@matter/types").BitFlag;
|
|
20
|
+
readonly motionLatching: import("@matter/types").BitFlag;
|
|
21
|
+
readonly unit: import("@matter/types").BitFlag;
|
|
22
|
+
readonly limitation: import("@matter/types").BitFlag;
|
|
23
|
+
readonly speed: import("@matter/types").BitFlag;
|
|
24
|
+
readonly translation: import("@matter/types").BitFlag;
|
|
25
|
+
readonly rotation: import("@matter/types").BitFlag;
|
|
26
|
+
readonly modulation: import("@matter/types").BitFlag;
|
|
27
|
+
};
|
|
28
|
+
readonly attributes: {
|
|
29
|
+
readonly currentState: import("@matter/types").Attribute<import("@matter/types").TypeFromFields<{
|
|
30
|
+
position: import("@matter/types").OptionalFieldType<number | null>;
|
|
31
|
+
latch: import("@matter/types").OptionalFieldType<boolean | null>;
|
|
32
|
+
speed: import("@matter/types").OptionalFieldType<import("@matter/types").ThreeLevelAuto>;
|
|
33
|
+
}> | null, any>;
|
|
34
|
+
readonly targetState: import("@matter/types").Attribute<import("@matter/types").TypeFromFields<{
|
|
35
|
+
position: import("@matter/types").OptionalFieldType<number | null>;
|
|
36
|
+
latch: import("@matter/types").OptionalFieldType<boolean | null>;
|
|
37
|
+
speed: import("@matter/types").OptionalFieldType<import("@matter/types").ThreeLevelAuto>;
|
|
38
|
+
}> | null, any>;
|
|
39
|
+
};
|
|
40
|
+
readonly commands: {
|
|
41
|
+
readonly setTarget: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
|
|
42
|
+
position: import("@matter/types").OptionalFieldType<number>;
|
|
43
|
+
latch: import("@matter/types").OptionalFieldType<boolean>;
|
|
44
|
+
speed: import("@matter/types").OptionalFieldType<import("@matter/types").ThreeLevelAuto>;
|
|
45
|
+
}>, void, any>;
|
|
46
|
+
};
|
|
47
|
+
readonly extensions: readonly [{
|
|
48
|
+
readonly flags: {
|
|
49
|
+
readonly positioning: true;
|
|
50
|
+
};
|
|
51
|
+
readonly component: {
|
|
52
|
+
readonly attributes: {
|
|
53
|
+
readonly resolution: import("@matter/types").FixedAttribute<number, any>;
|
|
54
|
+
readonly stepValue: import("@matter/types").FixedAttribute<number, any>;
|
|
55
|
+
};
|
|
56
|
+
readonly commands: {
|
|
57
|
+
readonly step: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
|
|
58
|
+
direction: import("@matter/types").FieldType<ClosureDimension.StepDirection>;
|
|
59
|
+
numberOfSteps: import("@matter/types").FieldType<number>;
|
|
60
|
+
speed: import("@matter/types").OptionalFieldType<import("@matter/types").ThreeLevelAuto>;
|
|
61
|
+
}>, void, any>;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
}, {
|
|
65
|
+
readonly flags: {
|
|
66
|
+
readonly motionLatching: true;
|
|
67
|
+
};
|
|
68
|
+
readonly component: {
|
|
69
|
+
readonly attributes: {
|
|
70
|
+
readonly latchControlModes: import("@matter/types").FixedAttribute<import("@matter/types").TypeFromPartialBitSchema<{
|
|
71
|
+
remoteLatching: import("@matter/types").BitFlag;
|
|
72
|
+
remoteUnlatching: import("@matter/types").BitFlag;
|
|
73
|
+
}>, any>;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
}, {
|
|
77
|
+
readonly flags: {
|
|
78
|
+
readonly unit: true;
|
|
79
|
+
};
|
|
80
|
+
readonly component: {
|
|
81
|
+
readonly attributes: {
|
|
82
|
+
readonly unit: import("@matter/types").FixedAttribute<ClosureDimension.ClosureUnit, any>;
|
|
83
|
+
readonly unitRange: import("@matter/types").Attribute<import("@matter/types").TypeFromFields<{
|
|
84
|
+
min: import("@matter/types").FieldType<number>;
|
|
85
|
+
max: import("@matter/types").FieldType<number>;
|
|
86
|
+
}> | null, any>;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
}, {
|
|
90
|
+
readonly flags: {
|
|
91
|
+
readonly limitation: true;
|
|
92
|
+
};
|
|
93
|
+
readonly component: {
|
|
94
|
+
readonly attributes: {
|
|
95
|
+
readonly limitRange: import("@matter/types").Attribute<import("@matter/types").TypeFromFields<{
|
|
96
|
+
min: import("@matter/types").FieldType<number>;
|
|
97
|
+
max: import("@matter/types").FieldType<number>;
|
|
98
|
+
}>, any>;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
}, {
|
|
102
|
+
readonly flags: {
|
|
103
|
+
readonly translation: true;
|
|
104
|
+
};
|
|
105
|
+
readonly component: {
|
|
106
|
+
readonly attributes: {
|
|
107
|
+
readonly translationDirection: import("@matter/types").FixedAttribute<ClosureDimension.TranslationDirection, any>;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}, {
|
|
111
|
+
readonly flags: {
|
|
112
|
+
readonly rotation: true;
|
|
113
|
+
};
|
|
114
|
+
readonly component: {
|
|
115
|
+
readonly attributes: {
|
|
116
|
+
readonly rotationAxis: import("@matter/types").FixedAttribute<ClosureDimension.RotationAxis, any>;
|
|
117
|
+
readonly overflow: import("@matter/types").FixedAttribute<ClosureDimension.Overflow, any>;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
}, {
|
|
121
|
+
readonly flags: {
|
|
122
|
+
readonly modulation: true;
|
|
123
|
+
};
|
|
124
|
+
readonly component: {
|
|
125
|
+
readonly attributes: {
|
|
126
|
+
readonly modulationType: import("@matter/types").FixedAttribute<ClosureDimension.ModulationType, any>;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
}, {
|
|
130
|
+
readonly flags: {
|
|
131
|
+
readonly positioning: false;
|
|
132
|
+
readonly motionLatching: false;
|
|
133
|
+
};
|
|
134
|
+
readonly component: false;
|
|
135
|
+
}, {
|
|
136
|
+
readonly flags: {
|
|
137
|
+
readonly unit: true;
|
|
138
|
+
readonly positioning: false;
|
|
139
|
+
};
|
|
140
|
+
readonly component: false;
|
|
141
|
+
}, {
|
|
142
|
+
readonly flags: {
|
|
143
|
+
readonly limitation: true;
|
|
144
|
+
readonly positioning: false;
|
|
145
|
+
};
|
|
146
|
+
readonly component: false;
|
|
147
|
+
}, {
|
|
148
|
+
readonly flags: {
|
|
149
|
+
readonly speed: true;
|
|
150
|
+
readonly positioning: false;
|
|
151
|
+
};
|
|
152
|
+
readonly component: false;
|
|
153
|
+
}, {
|
|
154
|
+
readonly flags: {
|
|
155
|
+
readonly translation: true;
|
|
156
|
+
readonly positioning: false;
|
|
157
|
+
};
|
|
158
|
+
readonly component: false;
|
|
159
|
+
}, {
|
|
160
|
+
readonly flags: {
|
|
161
|
+
readonly rotation: true;
|
|
162
|
+
readonly positioning: false;
|
|
163
|
+
};
|
|
164
|
+
readonly component: false;
|
|
165
|
+
}, {
|
|
166
|
+
readonly flags: {
|
|
167
|
+
readonly modulation: true;
|
|
168
|
+
readonly positioning: false;
|
|
169
|
+
};
|
|
170
|
+
readonly component: false;
|
|
171
|
+
}, {
|
|
172
|
+
readonly flags: {
|
|
173
|
+
readonly translation: true;
|
|
174
|
+
readonly rotation: true;
|
|
175
|
+
};
|
|
176
|
+
readonly component: false;
|
|
177
|
+
}, {
|
|
178
|
+
readonly flags: {
|
|
179
|
+
readonly translation: true;
|
|
180
|
+
readonly modulation: true;
|
|
181
|
+
};
|
|
182
|
+
readonly component: false;
|
|
183
|
+
}, {
|
|
184
|
+
readonly flags: {
|
|
185
|
+
readonly rotation: true;
|
|
186
|
+
readonly modulation: true;
|
|
187
|
+
};
|
|
188
|
+
readonly component: false;
|
|
189
|
+
}];
|
|
190
|
+
}>, readonly [ClosureDimension.Feature.Positioning]>, ClusterBehavior.Type<ClusterType.Of<{
|
|
10
191
|
readonly id: 261;
|
|
11
192
|
readonly name: "ClosureDimension";
|
|
12
193
|
readonly revision: 1;
|
|
@@ -182,22 +363,20 @@ declare const ClosureDimensionServerBase: ClusterBehavior.Type<import("@matter/t
|
|
|
182
363
|
};
|
|
183
364
|
readonly component: false;
|
|
184
365
|
}];
|
|
185
|
-
}>,
|
|
366
|
+
}>, typeof ClusterBehavior, {
|
|
367
|
+
components: never[];
|
|
368
|
+
}>, {
|
|
186
369
|
components: never[];
|
|
187
370
|
}>;
|
|
188
|
-
export declare
|
|
189
|
-
interface State {
|
|
190
|
-
currentState: ClosureDimension.DimensionState | null;
|
|
191
|
-
targetState: ClosureDimension.DimensionState | null;
|
|
192
|
-
resolution: number;
|
|
193
|
-
stepValue: number;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
export declare class ClosureDimensionServer extends ClosureDimensionServerBase {
|
|
371
|
+
export declare class ClosureDimensionServer extends ClosureDimensionServer_base {
|
|
197
372
|
state: ClosureDimensionServer.State;
|
|
198
373
|
setTarget: (request: ClosureDimension.SetTargetRequest) => MaybePromise;
|
|
199
374
|
step: (request: ClosureDimension.StepRequest) => MaybePromise;
|
|
200
375
|
}
|
|
376
|
+
export interface ClosurePanelOptions {
|
|
377
|
+
resolution?: number;
|
|
378
|
+
stepValue?: number;
|
|
379
|
+
}
|
|
201
380
|
export declare class ClosurePanel extends MatterbridgeEndpoint {
|
|
202
381
|
constructor(name: string, serial: string, options?: ClosurePanelOptions);
|
|
203
382
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { AttributeElement, ClusterElement, ClusterModel, CommandElement, DatatypeElement, FieldElement } from '@matter/main/model';
|
|
1
2
|
import { ClusterBehavior } from '@matter/node';
|
|
3
|
+
import { ClusterType } from '@matter/types';
|
|
2
4
|
import { ClosureDimension } from '../clusters/closure-dimension.js';
|
|
3
5
|
import { MatterbridgeServer } from '../matterbridgeBehaviors.js';
|
|
4
6
|
import { closurePanel } from '../matterbridgeDeviceTypes.js';
|
|
5
7
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const ClosureDimensionSchema = ClusterElement({
|
|
9
|
+
id: ClosureDimension.Cluster.id,
|
|
10
|
+
name: ClosureDimension.Cluster.name,
|
|
11
|
+
classification: 'application',
|
|
12
|
+
}, AttributeElement({ id: 0xfffd, name: 'ClusterRevision', type: 'ClusterRevision', conformance: 'M', default: ClosureDimension.Base.revision ?? 1 }), AttributeElement({ id: 0xfffc, name: 'FeatureMap', type: 'FeatureMap', conformance: 'M' }, FieldElement({ name: 'POS', constraint: '0', title: 'Positioning' }), FieldElement({ name: 'ML', constraint: '1', title: 'MotionLatching' }), FieldElement({ name: 'UNI', constraint: '2', title: 'Unit' }), FieldElement({ name: 'LIM', constraint: '3', title: 'Limitation' }), FieldElement({ name: 'SPD', constraint: '4', title: 'Speed' }), FieldElement({ name: 'TRN', constraint: '5', title: 'Translation' }), FieldElement({ name: 'ROT', constraint: '6', title: 'Rotation' }), FieldElement({ name: 'MOD', constraint: '7', title: 'Modulation' })), AttributeElement({ name: 'CurrentState', id: 0x0000, type: 'DimensionStateStruct', conformance: 'M', default: null, quality: 'X' }), AttributeElement({ name: 'TargetState', id: 0x0001, type: 'DimensionStateStruct', conformance: 'M', default: null, quality: 'X' }), AttributeElement({ name: 'Resolution', id: 0x0002, type: 'percent100ths', conformance: 'POS', default: 1 }), AttributeElement({ name: 'StepValue', id: 0x0003, type: 'percent100ths', conformance: 'POS', default: 1 }), CommandElement({ name: 'SetTarget', id: 0x0000, conformance: 'M', direction: 'request', response: 'status' }, FieldElement({ name: 'Position', id: 0, type: 'percent100ths', conformance: 'O' }), FieldElement({ name: 'Latch', id: 1, type: 'bool', conformance: 'O' }), FieldElement({ name: 'Speed', id: 2, type: 'ThreeLevelAutoEnum', conformance: 'O' })), CommandElement({ name: 'Step', id: 0x0001, conformance: 'POS', direction: 'request', response: 'status' }, FieldElement({ name: 'Direction', id: 0, type: 'StepDirectionEnum', conformance: 'M' }), FieldElement({ name: 'NumberOfSteps', id: 1, type: 'uint16', conformance: 'M', constraint: { min: 1 } }), FieldElement({ name: 'Speed', id: 2, type: 'ThreeLevelAutoEnum', conformance: 'O' })), DatatypeElement({ name: 'StepDirectionEnum', type: 'enum8' }, FieldElement({ name: 'Decrease', id: 0, conformance: 'M' }), FieldElement({ name: 'Increase', id: 1, conformance: 'M' })), DatatypeElement({ name: 'DimensionStateStruct', type: 'struct' }, FieldElement({ name: 'Position', id: 0, type: 'percent100ths', conformance: 'O', default: null, quality: 'X' }), FieldElement({ name: 'Latch', id: 1, type: 'bool', conformance: 'O', default: null, quality: 'X' }), FieldElement({ name: 'Speed', id: 2, type: 'ThreeLevelAutoEnum', conformance: 'O' })));
|
|
13
|
+
const ClosureDimensionBehavior = ClusterBehavior.for(ClusterType(ClosureDimension.Base), new ClusterModel(ClosureDimensionSchema));
|
|
14
|
+
export class ClosureDimensionServer extends ClosureDimensionBehavior.with(ClosureDimension.Feature.Positioning) {
|
|
10
15
|
setTarget = (request) => {
|
|
11
16
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
12
17
|
device.log.info(`SetTarget (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OperationalState } from '@matter/types/clusters/operational-state';
|
|
2
|
+
import { Semtag } from '@matter/types/globals';
|
|
2
3
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
3
4
|
export interface IrrigationSystemOptions {
|
|
4
5
|
operationalState?: OperationalState.OperationalStateEnum;
|
|
@@ -6,4 +7,5 @@ export interface IrrigationSystemOptions {
|
|
|
6
7
|
}
|
|
7
8
|
export declare class IrrigationSystem extends MatterbridgeEndpoint {
|
|
8
9
|
constructor(name: string, serial: string, options?: IrrigationSystemOptions);
|
|
10
|
+
addZone(tag: Semtag): this;
|
|
9
11
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { LocationTag } from '@matter/main/node';
|
|
1
2
|
import { OperationalState } from '@matter/types/clusters/operational-state';
|
|
2
|
-
import { irrigationSystem } from '../matterbridgeDeviceTypes.js';
|
|
3
|
+
import { irrigationSystem, waterValve } from '../matterbridgeDeviceTypes.js';
|
|
3
4
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
4
5
|
export class IrrigationSystem extends MatterbridgeEndpoint {
|
|
5
6
|
constructor(name, serial, options = {}) {
|
|
@@ -9,4 +10,10 @@ export class IrrigationSystem extends MatterbridgeEndpoint {
|
|
|
9
10
|
this.createDefaultOperationalStateClusterServer(options.operationalState ?? OperationalState.OperationalStateEnum.Stopped);
|
|
10
11
|
this.createDefaultFlowMeasurementClusterServer(options.flowMeasuredValue ?? null);
|
|
11
12
|
}
|
|
13
|
+
addZone(tag) {
|
|
14
|
+
this.addChildDeviceType(`Zone ${tag.tag}`, waterValve, { tagList: [tag, LocationTag.Zone] })
|
|
15
|
+
.createDefaultValveConfigurationAndControlClusterServer()
|
|
16
|
+
.addRequiredClusterServers();
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
12
19
|
}
|
|
@@ -85,8 +85,8 @@ declare const MatterbridgeMicrowaveOvenControlServer_base: import("@matter/node"
|
|
|
85
85
|
}];
|
|
86
86
|
}>, readonly [MicrowaveOvenControl.Feature.PowerInWatts]>, typeof MicrowaveOvenControlServer, import("@matter/node/behaviors/microwave-oven-control").MicrowaveOvenControlInterface>;
|
|
87
87
|
export declare class MatterbridgeMicrowaveOvenControlServer extends MatterbridgeMicrowaveOvenControlServer_base {
|
|
88
|
-
initialize(): void
|
|
89
|
-
setCookingParameters(request: MicrowaveOvenControl.SetCookingParametersRequest):
|
|
88
|
+
initialize(): Promise<void>;
|
|
89
|
+
setCookingParameters(request: MicrowaveOvenControl.SetCookingParametersRequest): Promise<void>;
|
|
90
90
|
addMoreTime(request: MicrowaveOvenControl.AddMoreTimeRequest): MaybePromise;
|
|
91
91
|
}
|
|
92
92
|
export {};
|
|
@@ -42,23 +42,24 @@ export class MicrowaveOven extends MatterbridgeEndpoint {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControlServer.with(MicrowaveOvenControl.Feature.PowerInWatts) {
|
|
45
|
-
initialize() {
|
|
45
|
+
async initialize() {
|
|
46
|
+
await super.initialize();
|
|
46
47
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
47
48
|
device.log.info('MatterbridgeMicrowaveOvenControlServer initialized');
|
|
48
49
|
}
|
|
49
|
-
setCookingParameters(request) {
|
|
50
|
+
async setCookingParameters(request) {
|
|
50
51
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
51
52
|
device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
52
53
|
device.commandHandler.executeHandler('setCookingParameters', { request, cluster: MicrowaveOvenControl.Cluster.id, attributes: this.state, endpoint: this.endpoint });
|
|
53
54
|
if (request.cookMode !== undefined) {
|
|
54
55
|
device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting cookMode to ${request.cookMode}`);
|
|
55
|
-
this.endpoint.setStateOf(MicrowaveOvenModeServer, { currentMode: request.cookMode });
|
|
56
|
+
await this.endpoint.setStateOf(MicrowaveOvenModeServer, { currentMode: request.cookMode });
|
|
56
57
|
}
|
|
57
58
|
else {
|
|
58
59
|
device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called with no cookMode so set to Normal`);
|
|
59
60
|
const supportedModes = this.endpoint.stateOf(MicrowaveOvenModeServer).supportedModes;
|
|
60
61
|
const normalMode = supportedModes.find((mode) => mode.modeTags.some((tag) => tag.value === MicrowaveOvenMode.ModeTag.Normal));
|
|
61
|
-
this.endpoint.setStateOf(MicrowaveOvenModeServer, { currentMode: normalMode?.mode });
|
|
62
|
+
await this.endpoint.setStateOf(MicrowaveOvenModeServer, { currentMode: normalMode?.mode });
|
|
62
63
|
}
|
|
63
64
|
if (request.cookTime !== undefined && request.cookTime >= 0 && request.cookTime <= this.state.maxCookTime) {
|
|
64
65
|
device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting cookTime to ${request.cookTime}`);
|
|
@@ -78,7 +79,7 @@ export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControl
|
|
|
78
79
|
}
|
|
79
80
|
if (request.startAfterSetting === true) {
|
|
80
81
|
device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting startAfterSetting = true`);
|
|
81
|
-
this.endpoint.setStateOf(MatterbridgeOperationalStateServer, { operationalState: OperationalState.OperationalStateEnum.Running });
|
|
82
|
+
await this.endpoint.setStateOf(MatterbridgeOperationalStateServer, { operationalState: OperationalState.OperationalStateEnum.Running });
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
addMoreTime(request) {
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import { ClusterBehavior } from '@matter/node';
|
|
2
|
+
import { type MeasurementAccuracy } from '@matter/types/globals';
|
|
2
3
|
import { SoilMeasurement } from '../clusters/soil-measurement.js';
|
|
3
4
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
5
|
+
declare const SoilMeasurementBehavior: ClusterBehavior.Type<SoilMeasurement.Cluster, typeof ClusterBehavior, {
|
|
6
|
+
components: never[];
|
|
7
|
+
}>;
|
|
8
|
+
export declare namespace SoilMeasurementServer {
|
|
9
|
+
interface State {
|
|
10
|
+
soilMoistureMeasurementLimits: MeasurementAccuracy;
|
|
11
|
+
soilMoistureMeasuredValue: number | null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export declare class SoilMeasurementServer extends SoilMeasurementBehavior {
|
|
15
|
+
state: SoilMeasurementServer.State;
|
|
16
|
+
}
|
|
4
17
|
export interface SoilSensorOptions {
|
|
18
|
+
soilMoistureMeasurementLimits?: MeasurementAccuracy;
|
|
5
19
|
soilMoistureMeasuredValue?: number | null;
|
|
6
20
|
}
|
|
7
|
-
export declare const SoilMeasurementServer: ClusterBehavior.Type<SoilMeasurement.Cluster, typeof ClusterBehavior, {
|
|
8
|
-
components: never[];
|
|
9
|
-
}>;
|
|
10
21
|
export declare class SoilSensor extends MatterbridgeEndpoint {
|
|
11
22
|
constructor(name: string, serial: string, options?: SoilSensorOptions);
|
|
12
23
|
setSoilMoistureMeasuredValue(value: number | null): Promise<void>;
|
|
13
24
|
getSoilMoistureMeasuredValue(): number | null;
|
|
14
25
|
}
|
|
26
|
+
export {};
|
|
@@ -1,17 +1,32 @@
|
|
|
1
|
+
import { AttributeElement, ClusterElement, ClusterModel } from '@matter/main/model';
|
|
1
2
|
import { ClusterBehavior } from '@matter/node';
|
|
2
3
|
import { MeasurementType } from '@matter/types/globals';
|
|
3
4
|
import { SoilMeasurement } from '../clusters/soil-measurement.js';
|
|
4
|
-
import { soilSensor } from '../matterbridgeDeviceTypes.js';
|
|
5
|
+
import { powerSource, soilSensor } from '../matterbridgeDeviceTypes.js';
|
|
5
6
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
const SoilMeasurementSchema = ClusterElement({
|
|
8
|
+
id: SoilMeasurement.Cluster.id,
|
|
9
|
+
name: SoilMeasurement.Cluster.name,
|
|
10
|
+
classification: 'application',
|
|
11
|
+
}, AttributeElement({ id: 0xfffd, name: 'ClusterRevision', type: 'ClusterRevision', conformance: 'M', default: SoilMeasurement.Cluster.revision ?? 1 }), AttributeElement({ id: 0xfffc, name: 'FeatureMap', type: 'FeatureMap', conformance: 'M', default: 0 }), AttributeElement({ id: 0x0000, name: 'soilMoistureMeasurementLimits', type: 'MeasurementAccuracyStruct', conformance: 'M' }), AttributeElement({
|
|
12
|
+
id: 0x0001,
|
|
13
|
+
name: 'soilMoistureMeasuredValue',
|
|
14
|
+
type: 'percent',
|
|
15
|
+
conformance: 'M',
|
|
16
|
+
quality: 'X',
|
|
17
|
+
default: null,
|
|
18
|
+
}));
|
|
19
|
+
const SoilMeasurementBehavior = ClusterBehavior.for(SoilMeasurement.Cluster, new ClusterModel(SoilMeasurementSchema));
|
|
20
|
+
export class SoilMeasurementServer extends SoilMeasurementBehavior {
|
|
21
|
+
}
|
|
8
22
|
export class SoilSensor extends MatterbridgeEndpoint {
|
|
9
23
|
constructor(name, serial, options = {}) {
|
|
10
|
-
super([soilSensor], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
|
|
24
|
+
super([soilSensor, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
|
|
11
25
|
this.createDefaultIdentifyClusterServer();
|
|
12
26
|
this.createDefaultBasicInformationClusterServer(name, serial, 0xfff1, 'Matterbridge', 0x8000, 'Matterbridge Soil Sensor');
|
|
27
|
+
this.createDefaultPowerSourceBatteryClusterServer();
|
|
13
28
|
this.behaviors.require(SoilMeasurementServer, {
|
|
14
|
-
soilMoistureMeasurementLimits: {
|
|
29
|
+
soilMoistureMeasurementLimits: options.soilMoistureMeasurementLimits ?? {
|
|
15
30
|
measurementType: MeasurementType.SoilMoisture,
|
|
16
31
|
measured: true,
|
|
17
32
|
minMeasuredValue: 0,
|
|
@@ -49,7 +49,7 @@ export declare namespace MatterbridgeServer {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
export declare class MatterbridgePowerSourceServer extends PowerSourceServer {
|
|
52
|
-
initialize(): void
|
|
52
|
+
initialize(): Promise<void>;
|
|
53
53
|
}
|
|
54
54
|
export declare class MatterbridgeIdentifyServer extends IdentifyServer {
|
|
55
55
|
identify(request: Identify.IdentifyRequest): MaybePromise;
|
|
@@ -2400,6 +2400,6 @@ export declare class MatterbridgeDeviceEnergyManagementServer extends Matterbrid
|
|
|
2400
2400
|
cancelPowerAdjustRequest(): MaybePromise;
|
|
2401
2401
|
}
|
|
2402
2402
|
export declare class MatterbridgeDeviceEnergyManagementModeServer extends DeviceEnergyManagementModeServer {
|
|
2403
|
-
changeToMode(request: ModeBase.ChangeToModeRequest):
|
|
2403
|
+
changeToMode(request: ModeBase.ChangeToModeRequest): Promise<ModeBase.ChangeToModeResponse>;
|
|
2404
2404
|
}
|
|
2405
2405
|
export {};
|
|
@@ -47,11 +47,12 @@ export class MatterbridgeServer extends Behavior {
|
|
|
47
47
|
MatterbridgeServer.State = State;
|
|
48
48
|
})(MatterbridgeServer || (MatterbridgeServer = {}));
|
|
49
49
|
export class MatterbridgePowerSourceServer extends PowerSourceServer {
|
|
50
|
-
initialize() {
|
|
50
|
+
async initialize() {
|
|
51
|
+
await super.initialize();
|
|
51
52
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
52
53
|
device.log.info(`Initializing MatterbridgePowerSourceServer (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
53
54
|
this.state.endpointList = [this.endpoint.number];
|
|
54
|
-
this.endpoint.construction.onSuccess(() => {
|
|
55
|
+
this.endpoint.construction.onSuccess(async () => {
|
|
55
56
|
device.log.debug(`MatterbridgePowerSourceServer: endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber} construction completed`);
|
|
56
57
|
const endpointList = [this.endpoint.number];
|
|
57
58
|
for (const endpoint of this.endpoint.parts) {
|
|
@@ -59,7 +60,7 @@ export class MatterbridgePowerSourceServer extends PowerSourceServer {
|
|
|
59
60
|
endpointList.push(endpoint.number);
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
this.endpoint.setStateOf(PowerSourceServer, { endpointList });
|
|
63
|
+
await this.endpoint.setStateOf(PowerSourceServer, { endpointList });
|
|
63
64
|
device.log.debug(`MatterbridgePowerSourceServer: endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber} construction completed with endpointList: ${endpointList.join(', ')}`);
|
|
64
65
|
});
|
|
65
66
|
}
|
|
@@ -543,7 +544,7 @@ export class MatterbridgeDeviceEnergyManagementServer extends DeviceEnergyManage
|
|
|
543
544
|
}
|
|
544
545
|
}
|
|
545
546
|
export class MatterbridgeDeviceEnergyManagementModeServer extends DeviceEnergyManagementModeServer {
|
|
546
|
-
changeToMode(request) {
|
|
547
|
+
async changeToMode(request) {
|
|
547
548
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
548
549
|
device.log.info(`Changing mode to ${request.newMode} (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
549
550
|
device.commandHandler.executeHandler('changeToMode', { request, cluster: DeviceEnergyManagementModeServer.id, attributes: this.state, endpoint: this.endpoint });
|
|
@@ -555,13 +556,13 @@ export class MatterbridgeDeviceEnergyManagementModeServer extends DeviceEnergyMa
|
|
|
555
556
|
this.state.currentMode = request.newMode;
|
|
556
557
|
if (supported.modeTags.find((tag) => tag.value === DeviceEnergyManagementMode.ModeTag.NoOptimization)) {
|
|
557
558
|
if (this.endpoint.behaviors.has(DeviceEnergyManagementServer))
|
|
558
|
-
this.endpoint.setStateOf(DeviceEnergyManagementServer.with(DeviceEnergyManagement.Feature.PowerForecastReporting, DeviceEnergyManagement.Feature.PowerAdjustment), {
|
|
559
|
+
await this.endpoint.setStateOf(DeviceEnergyManagementServer.with(DeviceEnergyManagement.Feature.PowerForecastReporting, DeviceEnergyManagement.Feature.PowerAdjustment), {
|
|
559
560
|
optOutState: DeviceEnergyManagement.OptOutState.OptOut,
|
|
560
561
|
});
|
|
561
562
|
}
|
|
562
563
|
else {
|
|
563
564
|
if (this.endpoint.behaviors.has(DeviceEnergyManagementServer))
|
|
564
|
-
this.endpoint.setStateOf(DeviceEnergyManagementServer.with(DeviceEnergyManagement.Feature.PowerForecastReporting, DeviceEnergyManagement.Feature.PowerAdjustment), {
|
|
565
|
+
await this.endpoint.setStateOf(DeviceEnergyManagementServer.with(DeviceEnergyManagement.Feature.PowerForecastReporting, DeviceEnergyManagement.Feature.PowerAdjustment), {
|
|
565
566
|
optOutState: DeviceEnergyManagement.OptOutState.NoOptOut,
|
|
566
567
|
});
|
|
567
568
|
}
|
|
@@ -256,15 +256,19 @@ export async function invokeBehaviorCommand(endpoint, cluster, command, params)
|
|
|
256
256
|
endpoint.log?.error(`invokeBehaviorCommand error: command ${hk}${command}${er} not found on endpoint ${or}${endpoint.maybeId}${er}:${or}${endpoint.maybeNumber}${er}`);
|
|
257
257
|
return false;
|
|
258
258
|
}
|
|
259
|
-
|
|
259
|
+
let invoked = true;
|
|
260
|
+
await endpoint.act(async (agent) => {
|
|
260
261
|
const behavior = agent[behaviorId];
|
|
261
|
-
|
|
262
|
+
const handler = behavior?.[command];
|
|
263
|
+
if (typeof handler !== 'function') {
|
|
262
264
|
endpoint.log?.error(`invokeBehaviorCommand error: command ${hk}${command}${er} not found on agent for endpoint ${or}${endpoint.maybeId}${er}:${or}${endpoint.maybeNumber}${er}`);
|
|
263
|
-
|
|
265
|
+
invoked = false;
|
|
266
|
+
return;
|
|
264
267
|
}
|
|
265
|
-
behavior
|
|
268
|
+
const result = params === undefined ? handler.call(behavior) : handler.call(behavior, params);
|
|
269
|
+
await Promise.resolve(result);
|
|
266
270
|
});
|
|
267
|
-
return
|
|
271
|
+
return invoked;
|
|
268
272
|
}
|
|
269
273
|
export async function invokeSubscribeHandler(endpoint, cluster, attribute, newValue, oldValue) {
|
|
270
274
|
const event = attribute + '$Changed';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/core",
|
|
3
|
-
"version": "3.6.0-dev-20260304-
|
|
3
|
+
"version": "3.6.0-dev-20260304-df69d06",
|
|
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.0-dev-20260304-
|
|
126
|
-
"@matterbridge/thread": "3.6.0-dev-20260304-
|
|
127
|
-
"@matterbridge/types": "3.6.0-dev-20260304-
|
|
128
|
-
"@matterbridge/utils": "3.6.0-dev-20260304-
|
|
125
|
+
"@matterbridge/dgram": "3.6.0-dev-20260304-df69d06",
|
|
126
|
+
"@matterbridge/thread": "3.6.0-dev-20260304-df69d06",
|
|
127
|
+
"@matterbridge/types": "3.6.0-dev-20260304-df69d06",
|
|
128
|
+
"@matterbridge/utils": "3.6.0-dev-20260304-df69d06",
|
|
129
129
|
"archiver": "7.0.1",
|
|
130
130
|
"express": "5.2.1",
|
|
131
131
|
"glob": "13.0.6",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ClusterModel } from '../matter/export.js';
|
|
2
|
-
type AnyCluster = {
|
|
3
|
-
id: number;
|
|
4
|
-
name: string;
|
|
5
|
-
revision?: number;
|
|
6
|
-
supportedFeatures?: Record<string, boolean>;
|
|
7
|
-
attributes?: Record<string, {
|
|
8
|
-
id: number;
|
|
9
|
-
default?: unknown;
|
|
10
|
-
optional?: boolean;
|
|
11
|
-
}>;
|
|
12
|
-
commands?: Record<string, {
|
|
13
|
-
requestId: number;
|
|
14
|
-
optional?: boolean;
|
|
15
|
-
}>;
|
|
16
|
-
events?: Record<string, {
|
|
17
|
-
id: number;
|
|
18
|
-
optional?: boolean;
|
|
19
|
-
}>;
|
|
20
|
-
};
|
|
21
|
-
export declare function createClusterSchema(cluster: AnyCluster): ClusterModel;
|
|
22
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { AttributeElement, ClusterModel, CommandElement, EventElement, FieldElement } from '../matter/export.js';
|
|
2
|
-
export function createClusterSchema(cluster) {
|
|
3
|
-
const children = [];
|
|
4
|
-
const featureNames = Object.keys(cluster.supportedFeatures ?? {});
|
|
5
|
-
if (featureNames.length > 0) {
|
|
6
|
-
children.push(AttributeElement({
|
|
7
|
-
id: 0xfffc,
|
|
8
|
-
name: 'FeatureMap',
|
|
9
|
-
type: 'FeatureMap',
|
|
10
|
-
conformance: 'M',
|
|
11
|
-
}, ...featureNames.map((name, index) => FieldElement({
|
|
12
|
-
name,
|
|
13
|
-
id: index,
|
|
14
|
-
type: 'bool',
|
|
15
|
-
constraint: index,
|
|
16
|
-
}))));
|
|
17
|
-
}
|
|
18
|
-
for (const [name, attribute] of Object.entries(cluster.attributes ?? {})) {
|
|
19
|
-
children.push(AttributeElement({
|
|
20
|
-
id: attribute.id,
|
|
21
|
-
name,
|
|
22
|
-
type: 'any',
|
|
23
|
-
conformance: 'O',
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
for (const [name, command] of Object.entries(cluster.commands ?? {})) {
|
|
27
|
-
const element = CommandElement({
|
|
28
|
-
id: command.requestId,
|
|
29
|
-
name,
|
|
30
|
-
type: 'any',
|
|
31
|
-
direction: 'request',
|
|
32
|
-
conformance: 'O',
|
|
33
|
-
});
|
|
34
|
-
element.operationalIsSupported = true;
|
|
35
|
-
children.push(element);
|
|
36
|
-
}
|
|
37
|
-
for (const [name, event] of Object.entries(cluster.events ?? {})) {
|
|
38
|
-
const element = EventElement({
|
|
39
|
-
id: event.id,
|
|
40
|
-
name,
|
|
41
|
-
type: 'any',
|
|
42
|
-
priority: name === 'operationalError' ? 'critical' : 'info',
|
|
43
|
-
conformance: 'O',
|
|
44
|
-
});
|
|
45
|
-
element.operationalIsSupported = true;
|
|
46
|
-
children.push(element);
|
|
47
|
-
}
|
|
48
|
-
return new ClusterModel({
|
|
49
|
-
id: cluster.id,
|
|
50
|
-
name: cluster.name,
|
|
51
|
-
revision: cluster.revision ?? 1,
|
|
52
|
-
}, ...children);
|
|
53
|
-
}
|