matterbridge-zigbee2mqtt 2.3.1-dev.2 → 2.3.2

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/CHANGELOG.md CHANGED
@@ -4,19 +4,30 @@ If you like this project and find it useful, please consider giving it a star on
4
4
 
5
5
  All notable changes to this project will be documented in this file.
6
6
 
7
+ ## [2.3.2] - 2024-12-24
8
+
9
+ ### Changed
10
+
11
+ - [package]: Updated package.
12
+ - [package]: Updated dependencies.
13
+ - [plugin]: Use platform white and black list.
14
+ - [platform]: Use platform endpoint number check.
15
+
16
+ <a href="https://www.buymeacoffee.com/luligugithub">
17
+ <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
18
+ </a>
19
+
7
20
  ## [2.3.1] - 2024-12-12
8
21
 
9
22
  ### Added
10
23
 
11
- - [matterbridge]: Verified to work with Matterbridge edge (matter.js new API).
12
- - [covers]: Add position movement updates to the controller.
13
- - [covers]: Fix group cover at controller.
14
- - [zigbeeEntity]: Add create async to ZigbeeDevice and ZigbeeGroup.
24
+ - [colorControl] Update ColorControl cluster
25
+ - [levelControl] Update currentLevel to minLevel
15
26
 
16
27
  ### Changed
17
28
 
18
29
  - [package]: Updated dependencies.
19
- - [plugin]: Requires Matterbridge 1.6.5.
30
+ - [plugin]: Requires Matterbridge 1.6.6.
20
31
 
21
32
  ### Fixed
22
33
 
package/README.md CHANGED
@@ -106,7 +106,7 @@ matterbridge -add ./
106
106
  Then start Matterbridge
107
107
 
108
108
  ```
109
- matterbridge -bridge
109
+ matterbridge
110
110
  ```
111
111
 
112
112
  # Config file
@@ -174,7 +174,7 @@ If you want to exclude "temperature" and "humidity" for the device "My motion se
174
174
  }
175
175
  ```
176
176
 
177
- By default matterbridge uses hostname in order to make entities unique, however in some cases
177
+ By default matterbridge-zigbee2mqtt uses hostname in order to make entities unique, however in some cases
178
178
  you may not want this behavior. You can use "postfixHostname" boolean flag to disable this behavior:
179
179
 
180
180
  ```json
@@ -217,8 +217,6 @@ The latest release also supports all clusters in the multi endpoints devices (e.
217
217
 
218
218
  Since the Matter support in the available ecosystems (controllers) is sometimes limited and, when available, only covers Matter 1.1 specifications, some z2m devices cannot be exposed properly or cannot be exposed at all.
219
219
 
220
- We discoverd that Matter support in Home Assistant includes some clusters not supported by other ecosystems. These clusters like EveHistory have been added so with HA you can see Voltage, Current, Consumption and TotalConsumption (screenshot https://github.com/Luligu/matterbridge/blob/main/screenshot/Screenshot%20HA%20sm-dc-power-m.png).
221
-
222
220
  ## Unsupported devices
223
221
 
224
222
  If one of your devices is not supported out of the box, open an issue and we will try to support it if possible.
@@ -254,16 +252,13 @@ For general controller issues check the Matterbridge Known issues section
254
252
 
255
253
  ## Apple Home
256
254
 
257
- ## Home Assistant (Matter Server is still in Beta)
255
+ ## Home Assistant
258
256
 
259
257
  ## Google Home
260
258
 
261
259
  ## Alexa
262
260
 
263
- In the plugin config add each switch device to the lightList or outletList if they don't show up like switch (Matterbridge uses a modified switch device type without client cluster that Alexa doesn't recognize).
261
+ In the plugin config add each switch device to the lightList or outletList. Matterbridge uses a modified switch device type without client cluster that Alexa doesn't recognize.
264
262
 
265
263
  ## SmartThings
266
264
 
267
- ## eWeLink
268
-
269
- ## Tuya/Smart Life
@@ -0,0 +1,492 @@
1
+ /**
2
+ * This file contains the classes ZigbeeEntity, ZigbeeDevice and ZigbeeGroup.
3
+ *
4
+ * @file entity.ts
5
+ * @author Luca Liguori
6
+ * @date 2023-12-29
7
+ * @version 3.1.0
8
+ *
9
+ * Copyright 2023, 2024, 2025 Luca Liguori.
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License. *
22
+ */
23
+ import { DeviceTypeDefinition, MatterbridgeDevice, PowerSource, ClusterId, BridgedDeviceBasicInformation, Endpoint, EndpointOptions, ClusterServerObj, ClusterClientObj, Semtag, AtLeastOne } from 'matterbridge';
24
+ import { AnsiLogger } from 'matterbridge/logger';
25
+ import EventEmitter from 'events';
26
+ import { ZigbeePlatform } from './platform.js';
27
+ import { BridgeDevice, BridgeGroup } from './zigbee2mqttTypes.js';
28
+ import { Payload, PayloadValue } from './payloadTypes.js';
29
+ /**
30
+ * Represents a Zigbee entity: a group or a device.
31
+ *
32
+ * @class
33
+ * @extends {EventEmitter}
34
+ */
35
+ export declare class ZigbeeEntity extends EventEmitter {
36
+ log: AnsiLogger;
37
+ serial: string;
38
+ protected platform: ZigbeePlatform;
39
+ device: BridgeDevice | undefined;
40
+ group: BridgeGroup | undefined;
41
+ entityName: string;
42
+ isDevice: boolean;
43
+ isGroup: boolean;
44
+ actions: string[];
45
+ protected en: string;
46
+ protected ien: string;
47
+ bridgedDevice: MatterbridgeDevice | undefined;
48
+ eidn: string;
49
+ private lastPayload;
50
+ private lastSeen;
51
+ protected ignoreFeatures: string[];
52
+ protected transition: boolean;
53
+ protected propertyMap: Map<string, {
54
+ name: string;
55
+ type: string;
56
+ endpoint: string;
57
+ values?: string;
58
+ value_min?: number;
59
+ value_max?: number;
60
+ unit?: string;
61
+ category?: string;
62
+ description?: string;
63
+ label?: string;
64
+ action?: string;
65
+ }>;
66
+ protected readonly mutableDevice: Map<string, {
67
+ tagList: Semtag[];
68
+ deviceTypes: DeviceTypeDefinition[];
69
+ clusterServersIds: ClusterId[];
70
+ clusterServersObjs: ClusterServerObj[];
71
+ clusterClientsIds: ClusterId[];
72
+ clusterClientsObjs: ClusterClientObj[];
73
+ }>;
74
+ colorTimeout: NodeJS.Timeout | undefined;
75
+ thermostatTimeout: NodeJS.Timeout | undefined;
76
+ protected composedType: string;
77
+ protected hasEndpoints: boolean;
78
+ isRouter: boolean;
79
+ protected noUpdate: boolean;
80
+ /**
81
+ * Creates an instance of ZigbeeEntity.
82
+ *
83
+ * @param {ZigbeePlatform} platform - The Zigbee platform instance.
84
+ * @param {BridgeDevice | BridgeGroup} entity - The bridge device or group instance received from zigbee2mqtt.
85
+ */
86
+ constructor(platform: ZigbeePlatform, entity: BridgeDevice | BridgeGroup);
87
+ /**
88
+ * Destroys the ZigbeeEntity instance by clearing any active timeouts.
89
+ *
90
+ * @remarks
91
+ * This method is used to clean up the ZigbeeEntity instance by clearing any active timeouts for color and thermostat operations.
92
+ * It ensures that no further actions are taken on these timeouts after the entity is destroyed.
93
+ */
94
+ destroy(): void;
95
+ /**
96
+ * Creates a mutable device with the specified definition and includes the specified server list.
97
+ *
98
+ * @param {DeviceTypeDefinition | AtLeastOne<DeviceTypeDefinition>} definition - The device type definition.
99
+ * @param {ClusterId[]} [includeServerList=[]] - The list of server clusters to include.
100
+ * @param {EndpointOptions} [options] - Optional endpoint options.
101
+ * @param {boolean} [debug] - Optional debug flag.
102
+ * @returns {MatterbridgeDevice} The created mutable device.
103
+ *
104
+ * @remarks
105
+ * This method creates a mutable device based on the provided definition. It adds the specified server clusters
106
+ * to the device and configures the device with basic information and power source clusters. If the device is a
107
+ * coordinator, it sets up the basic information cluster with coordinator-specific details. If the device is a
108
+ * group, it sets up the basic information cluster with group-specific details. The method also configures the
109
+ * power source cluster based on the device's power source.
110
+ */
111
+ protected createMutableDevice(definition: DeviceTypeDefinition | AtLeastOne<DeviceTypeDefinition>, options?: EndpointOptions, debug?: boolean): Promise<MatterbridgeDevice>;
112
+ protected getBridgedDeviceBasicInformation(): ClusterServerObj<BridgedDeviceBasicInformation.Cluster>;
113
+ protected addBridgedDeviceBasicInformation(): MatterbridgeDevice;
114
+ protected getPowerSource(): ClusterServerObj<import("matterbridge").ClusterComposer.Of<import("matterbridge").ClusterType.Of<{
115
+ readonly id: 47;
116
+ readonly name: "PowerSource";
117
+ readonly revision: 2;
118
+ readonly features: {
119
+ readonly wired: import("matterbridge").BitFlag;
120
+ readonly battery: import("matterbridge").BitFlag;
121
+ readonly rechargeable: import("matterbridge").BitFlag;
122
+ readonly replaceable: import("matterbridge").BitFlag;
123
+ };
124
+ readonly attributes: {
125
+ readonly status: import("matterbridge").Attribute<PowerSource.PowerSourceStatus, any>;
126
+ readonly order: import("matterbridge").Attribute<number, any>;
127
+ readonly description: import("matterbridge").FixedAttribute<string, any>;
128
+ readonly endpointList: import("matterbridge").Attribute<import("matterbridge").EndpointNumber[], any>;
129
+ };
130
+ readonly extensions: readonly [{
131
+ readonly flags: {
132
+ readonly wired: true;
133
+ };
134
+ readonly component: {
135
+ readonly attributes: {
136
+ readonly wiredAssessedInputVoltage: import("matterbridge").OptionalAttribute<number | null, any>;
137
+ readonly wiredAssessedInputFrequency: import("matterbridge").OptionalAttribute<number | null, any>;
138
+ readonly wiredCurrentType: import("matterbridge").FixedAttribute<PowerSource.WiredCurrentType, any>;
139
+ readonly wiredAssessedCurrent: import("matterbridge").OptionalAttribute<number | null, any>;
140
+ readonly wiredNominalVoltage: import("matterbridge").OptionalFixedAttribute<number, any>;
141
+ readonly wiredMaximumCurrent: import("matterbridge").OptionalFixedAttribute<number, any>;
142
+ readonly wiredPresent: import("matterbridge").OptionalAttribute<boolean, any>;
143
+ readonly activeWiredFaults: import("matterbridge").OptionalAttribute<PowerSource.WiredFault[], any>;
144
+ };
145
+ readonly events: {
146
+ readonly wiredFaultChange: import("matterbridge").OptionalEvent<import("matterbridge").TypeFromFields<{
147
+ current: import("matterbridge").FieldType<PowerSource.WiredFault[]>;
148
+ previous: import("matterbridge").FieldType<PowerSource.WiredFault[]>;
149
+ }>, any>;
150
+ };
151
+ };
152
+ }, {
153
+ readonly flags: {
154
+ readonly battery: true;
155
+ };
156
+ readonly component: {
157
+ readonly attributes: {
158
+ readonly batVoltage: import("matterbridge").OptionalAttribute<number | null, any>;
159
+ readonly batPercentRemaining: import("matterbridge").OptionalAttribute<number | null, any>;
160
+ readonly batTimeRemaining: import("matterbridge").OptionalAttribute<number | null, any>;
161
+ readonly batChargeLevel: import("matterbridge").Attribute<PowerSource.BatChargeLevel, any>;
162
+ readonly batReplacementNeeded: import("matterbridge").Attribute<boolean, any>;
163
+ readonly batReplaceability: import("matterbridge").FixedAttribute<PowerSource.BatReplaceability, any>;
164
+ readonly batPresent: import("matterbridge").OptionalAttribute<boolean, any>;
165
+ readonly activeBatFaults: import("matterbridge").OptionalAttribute<PowerSource.BatFault[], any>;
166
+ };
167
+ readonly events: {
168
+ readonly batFaultChange: import("matterbridge").OptionalEvent<import("matterbridge").TypeFromFields<{
169
+ current: import("matterbridge").FieldType<PowerSource.BatFault[]>;
170
+ previous: import("matterbridge").FieldType<PowerSource.BatFault[]>;
171
+ }>, any>;
172
+ };
173
+ };
174
+ }, {
175
+ readonly flags: {
176
+ readonly replaceable: true;
177
+ };
178
+ readonly component: {
179
+ readonly attributes: {
180
+ readonly batReplacementDescription: import("matterbridge").FixedAttribute<string, any>;
181
+ readonly batCommonDesignation: import("matterbridge").OptionalFixedAttribute<PowerSource.BatCommonDesignation, any>;
182
+ readonly batAnsiDesignation: import("matterbridge").OptionalFixedAttribute<string, any>;
183
+ readonly batIecDesignation: import("matterbridge").OptionalFixedAttribute<string, any>;
184
+ readonly batApprovedChemistry: import("matterbridge").OptionalFixedAttribute<PowerSource.BatApprovedChemistry, any>;
185
+ readonly batQuantity: import("matterbridge").FixedAttribute<number, any>;
186
+ };
187
+ };
188
+ }, {
189
+ readonly flags: {
190
+ readonly replaceable: true;
191
+ };
192
+ readonly component: {
193
+ readonly attributes: {
194
+ readonly batCapacity: import("matterbridge").OptionalFixedAttribute<number, any>;
195
+ };
196
+ };
197
+ }, {
198
+ readonly flags: {
199
+ readonly rechargeable: true;
200
+ };
201
+ readonly component: {
202
+ readonly attributes: {
203
+ readonly batCapacity: import("matterbridge").OptionalFixedAttribute<number, any>;
204
+ };
205
+ };
206
+ }, {
207
+ readonly flags: {
208
+ readonly rechargeable: true;
209
+ };
210
+ readonly component: {
211
+ readonly attributes: {
212
+ readonly batChargeState: import("matterbridge").Attribute<PowerSource.BatChargeState, any>;
213
+ readonly batTimeToFullCharge: import("matterbridge").OptionalAttribute<number | null, any>;
214
+ readonly batFunctionalWhileCharging: import("matterbridge").Attribute<boolean, any>;
215
+ readonly batChargingCurrent: import("matterbridge").OptionalAttribute<number | null, any>;
216
+ readonly activeBatChargeFaults: import("matterbridge").OptionalAttribute<PowerSource.BatChargeFault[], any>;
217
+ };
218
+ readonly events: {
219
+ readonly batChargeFaultChange: import("matterbridge").OptionalEvent<import("matterbridge").TypeFromFields<{
220
+ current: import("matterbridge").FieldType<PowerSource.BatChargeFault[]>;
221
+ previous: import("matterbridge").FieldType<PowerSource.BatChargeFault[]>;
222
+ }>, any>;
223
+ };
224
+ };
225
+ }, {
226
+ readonly flags: {
227
+ readonly rechargeable: true;
228
+ readonly battery: false;
229
+ };
230
+ readonly component: false;
231
+ }, {
232
+ readonly flags: {
233
+ readonly replaceable: true;
234
+ readonly battery: false;
235
+ };
236
+ readonly component: false;
237
+ }];
238
+ }>, readonly [PowerSource.Feature.Battery, PowerSource.Feature.Replaceable]>> | ClusterServerObj<import("matterbridge").ClusterComposer.Of<import("matterbridge").ClusterType.Of<{
239
+ readonly id: 47;
240
+ readonly name: "PowerSource";
241
+ readonly revision: 2;
242
+ readonly features: {
243
+ readonly wired: import("matterbridge").BitFlag;
244
+ readonly battery: import("matterbridge").BitFlag;
245
+ readonly rechargeable: import("matterbridge").BitFlag;
246
+ readonly replaceable: import("matterbridge").BitFlag;
247
+ };
248
+ readonly attributes: {
249
+ readonly status: import("matterbridge").Attribute<PowerSource.PowerSourceStatus, any>;
250
+ readonly order: import("matterbridge").Attribute<number, any>;
251
+ readonly description: import("matterbridge").FixedAttribute<string, any>;
252
+ readonly endpointList: import("matterbridge").Attribute<import("matterbridge").EndpointNumber[], any>;
253
+ };
254
+ readonly extensions: readonly [{
255
+ readonly flags: {
256
+ readonly wired: true;
257
+ };
258
+ readonly component: {
259
+ readonly attributes: {
260
+ readonly wiredAssessedInputVoltage: import("matterbridge").OptionalAttribute<number | null, any>;
261
+ readonly wiredAssessedInputFrequency: import("matterbridge").OptionalAttribute<number | null, any>;
262
+ readonly wiredCurrentType: import("matterbridge").FixedAttribute<PowerSource.WiredCurrentType, any>;
263
+ readonly wiredAssessedCurrent: import("matterbridge").OptionalAttribute<number | null, any>;
264
+ readonly wiredNominalVoltage: import("matterbridge").OptionalFixedAttribute<number, any>;
265
+ readonly wiredMaximumCurrent: import("matterbridge").OptionalFixedAttribute<number, any>;
266
+ readonly wiredPresent: import("matterbridge").OptionalAttribute<boolean, any>;
267
+ readonly activeWiredFaults: import("matterbridge").OptionalAttribute<PowerSource.WiredFault[], any>;
268
+ };
269
+ readonly events: {
270
+ readonly wiredFaultChange: import("matterbridge").OptionalEvent<import("matterbridge").TypeFromFields<{
271
+ current: import("matterbridge").FieldType<PowerSource.WiredFault[]>;
272
+ previous: import("matterbridge").FieldType<PowerSource.WiredFault[]>;
273
+ }>, any>;
274
+ };
275
+ };
276
+ }, {
277
+ readonly flags: {
278
+ readonly battery: true;
279
+ };
280
+ readonly component: {
281
+ readonly attributes: {
282
+ readonly batVoltage: import("matterbridge").OptionalAttribute<number | null, any>;
283
+ readonly batPercentRemaining: import("matterbridge").OptionalAttribute<number | null, any>;
284
+ readonly batTimeRemaining: import("matterbridge").OptionalAttribute<number | null, any>;
285
+ readonly batChargeLevel: import("matterbridge").Attribute<PowerSource.BatChargeLevel, any>;
286
+ readonly batReplacementNeeded: import("matterbridge").Attribute<boolean, any>;
287
+ readonly batReplaceability: import("matterbridge").FixedAttribute<PowerSource.BatReplaceability, any>;
288
+ readonly batPresent: import("matterbridge").OptionalAttribute<boolean, any>;
289
+ readonly activeBatFaults: import("matterbridge").OptionalAttribute<PowerSource.BatFault[], any>;
290
+ };
291
+ readonly events: {
292
+ readonly batFaultChange: import("matterbridge").OptionalEvent<import("matterbridge").TypeFromFields<{
293
+ current: import("matterbridge").FieldType<PowerSource.BatFault[]>;
294
+ previous: import("matterbridge").FieldType<PowerSource.BatFault[]>;
295
+ }>, any>;
296
+ };
297
+ };
298
+ }, {
299
+ readonly flags: {
300
+ readonly replaceable: true;
301
+ };
302
+ readonly component: {
303
+ readonly attributes: {
304
+ readonly batReplacementDescription: import("matterbridge").FixedAttribute<string, any>;
305
+ readonly batCommonDesignation: import("matterbridge").OptionalFixedAttribute<PowerSource.BatCommonDesignation, any>;
306
+ readonly batAnsiDesignation: import("matterbridge").OptionalFixedAttribute<string, any>;
307
+ readonly batIecDesignation: import("matterbridge").OptionalFixedAttribute<string, any>;
308
+ readonly batApprovedChemistry: import("matterbridge").OptionalFixedAttribute<PowerSource.BatApprovedChemistry, any>;
309
+ readonly batQuantity: import("matterbridge").FixedAttribute<number, any>;
310
+ };
311
+ };
312
+ }, {
313
+ readonly flags: {
314
+ readonly replaceable: true;
315
+ };
316
+ readonly component: {
317
+ readonly attributes: {
318
+ readonly batCapacity: import("matterbridge").OptionalFixedAttribute<number, any>;
319
+ };
320
+ };
321
+ }, {
322
+ readonly flags: {
323
+ readonly rechargeable: true;
324
+ };
325
+ readonly component: {
326
+ readonly attributes: {
327
+ readonly batCapacity: import("matterbridge").OptionalFixedAttribute<number, any>;
328
+ };
329
+ };
330
+ }, {
331
+ readonly flags: {
332
+ readonly rechargeable: true;
333
+ };
334
+ readonly component: {
335
+ readonly attributes: {
336
+ readonly batChargeState: import("matterbridge").Attribute<PowerSource.BatChargeState, any>;
337
+ readonly batTimeToFullCharge: import("matterbridge").OptionalAttribute<number | null, any>;
338
+ readonly batFunctionalWhileCharging: import("matterbridge").Attribute<boolean, any>;
339
+ readonly batChargingCurrent: import("matterbridge").OptionalAttribute<number | null, any>;
340
+ readonly activeBatChargeFaults: import("matterbridge").OptionalAttribute<PowerSource.BatChargeFault[], any>;
341
+ };
342
+ readonly events: {
343
+ readonly batChargeFaultChange: import("matterbridge").OptionalEvent<import("matterbridge").TypeFromFields<{
344
+ current: import("matterbridge").FieldType<PowerSource.BatChargeFault[]>;
345
+ previous: import("matterbridge").FieldType<PowerSource.BatChargeFault[]>;
346
+ }>, any>;
347
+ };
348
+ };
349
+ }, {
350
+ readonly flags: {
351
+ readonly rechargeable: true;
352
+ readonly battery: false;
353
+ };
354
+ readonly component: false;
355
+ }, {
356
+ readonly flags: {
357
+ readonly replaceable: true;
358
+ readonly battery: false;
359
+ };
360
+ readonly component: false;
361
+ }];
362
+ }>, readonly [PowerSource.Feature.Wired]>>;
363
+ protected addPowerSource(): MatterbridgeDevice;
364
+ /**
365
+ * Verifies that all required server clusters are present on the main endpoint and child endpoints.
366
+ *
367
+ * @param {MatterbridgeDevice} endpoint - The device endpoint to verify.
368
+ * @returns {boolean} True if all required server clusters are present, false otherwise.
369
+ *
370
+ * @remarks
371
+ * This method checks if all required server clusters are present on the main endpoint and its child endpoints.
372
+ * It logs an error message if any required server cluster is missing and returns false. If all required server
373
+ * clusters are present, it returns true.
374
+ */
375
+ protected verifyMutableDevice(endpoint: MatterbridgeDevice): boolean;
376
+ /**
377
+ * Configures the device by setting up the WindowCovering and DoorLock clusters if they are present.
378
+ *
379
+ * @returns {Promise<void>} A promise that resolves when the configuration is complete.
380
+ *
381
+ * @remarks
382
+ * This method configures the device by checking for the presence of the WindowCovering and DoorLock clusters.
383
+ * If the WindowCovering cluster is present, it sets the target as the current position and stops any ongoing
384
+ * movement. If the DoorLock cluster is present, it retrieves the lock state and triggers the appropriate lock
385
+ * operation event based on the current state.
386
+ */
387
+ configure(): Promise<void>;
388
+ /**
389
+ * Updates the attribute of a cluster on a device endpoint if the value has changed.
390
+ *
391
+ * @param {Endpoint} deviceEndpoint - The device endpoint to update.
392
+ * @param {string | undefined} childEndpointName - The name of the child endpoint, if any.
393
+ * @param {number} clusterId - The ID of the cluster to update.
394
+ * @param {string} attributeName - The name of the attribute to update.
395
+ * @param {PayloadValue} value - The new value of the attribute.
396
+ * @param {string[]} [lookup] - Optional lookup array for converting string values to indices.
397
+ *
398
+ * @remarks
399
+ * This method checks if the specified attribute of a cluster on a device endpoint has changed. If the attribute
400
+ * has changed, it updates the attribute with the new value. If a lookup array is provided, it converts string
401
+ * values to their corresponding indices in the lookup array. The method logs the update process and handles any
402
+ * errors that occur during the update.
403
+ */
404
+ protected updateAttributeIfChanged(deviceEndpoint: Endpoint, childEndpointName: string | undefined, clusterId: number, attributeName: string, value: PayloadValue, lookup?: string[]): void;
405
+ /**
406
+ * Publishes a command to the specified entity with the given payload.
407
+ *
408
+ * @param {string} command - The command to execute.
409
+ * @param {string} entityName - The name of the entity to publish the command to.
410
+ * @param {Payload} payload - The payload of the command.
411
+ *
412
+ * @remarks
413
+ * This method logs the execution of the command and publishes the command to the specified entity.
414
+ * If the entity name starts with 'bridge/request', it publishes the payload without a 'set' suffix.
415
+ * Otherwise, it publishes the payload with a 'set' suffix.
416
+ */
417
+ protected publishCommand(command: string, entityName: string, payload: Payload): void;
418
+ /**
419
+ * Logs the property map of the Zigbee entity.
420
+ *
421
+ * @remarks
422
+ * This method iterates over the property map of the Zigbee entity and logs each property's details,
423
+ * including its name, type, values, minimum and maximum values, unit, and endpoint.
424
+ */
425
+ protected logPropertyMap(): void;
426
+ }
427
+ /**
428
+ * Represents a Zigbee group entity.
429
+ *
430
+ * @class
431
+ * @extends {ZigbeeEntity}
432
+ */
433
+ export declare class ZigbeeGroup extends ZigbeeEntity {
434
+ /**
435
+ * Creates an instance of ZigbeeGroup.
436
+ *
437
+ * @param {ZigbeePlatform} platform - The Zigbee platform instance.
438
+ * @param {BridgeGroup} group - The bridge group instance.
439
+ */
440
+ private constructor();
441
+ /**
442
+ * Creates a new ZigbeeGroup instance.
443
+ *
444
+ * @param {ZigbeePlatform} platform - The Zigbee platform instance.
445
+ * @param {BridgeGroup} group - The bridge group instance.
446
+ * @returns {Promise<ZigbeeGroup>} A promise that resolves to the created ZigbeeGroup instance.
447
+ *
448
+ * @remarks
449
+ * This method initializes a new ZigbeeGroup instance, sets up its properties, and configures the device
450
+ * based on the group members. It also adds command handlers for the group.
451
+ */
452
+ static create(platform: ZigbeePlatform, group: BridgeGroup): Promise<ZigbeeGroup>;
453
+ }
454
+ export interface ZigbeeToMatter {
455
+ type: string;
456
+ name: string;
457
+ property: string;
458
+ deviceType: DeviceTypeDefinition;
459
+ cluster: number;
460
+ attribute: string;
461
+ converter?: (value: any) => any;
462
+ valueLookup?: string[];
463
+ }
464
+ export declare const z2ms: ZigbeeToMatter[];
465
+ /**
466
+ * Represents a Zigbee device entity.
467
+ *
468
+ * @class
469
+ * @extends {ZigbeeEntity}
470
+ */
471
+ export declare class ZigbeeDevice extends ZigbeeEntity {
472
+ /**
473
+ * Represents a Zigbee device entity.
474
+ *
475
+ * @class
476
+ * @extends {ZigbeeEntity}
477
+ */
478
+ private constructor();
479
+ /**
480
+ * Creates a new ZigbeeDevice instance.
481
+ *
482
+ * @param {ZigbeePlatform} platform - The Zigbee platform instance.
483
+ * @param {BridgeDevice} device - The bridge device instance.
484
+ * @returns {Promise<ZigbeeDevice>} A promise that resolves to the created ZigbeeDevice instance.
485
+ *
486
+ * @remarks
487
+ * This method initializes a new ZigbeeDevice instance, sets up its properties, and configures the device
488
+ * based on the device definition and options. It also adds command handlers for the device.
489
+ */
490
+ static create(platform: ZigbeePlatform, device: BridgeDevice): Promise<ZigbeeDevice>;
491
+ }
492
+ //# sourceMappingURL=entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../src/entity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAelB,WAAW,EACX,SAAS,EAGT,6BAA6B,EAG7B,QAAQ,EAmBR,eAAe,EAOf,gBAAgB,EAChB,gBAAgB,EAchB,MAAM,EACN,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAyG,MAAM,qBAAqB,CAAC;AAIxJ,O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