matterbridge-zigbee2mqtt 2.2.2 → 2.3.0-dev.1

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,6 +4,25 @@ 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.0] - 2024-12-01
8
+
9
+ ### Added
10
+
11
+ - [matterbridge]: Verified to work with Matterbridge edge (matter.js new API).
12
+ - [covers]: Add position movement to the controller.
13
+ - [covers]: Fix group cover at controller.
14
+ - [zigbeeEntity]: Add create async to ZigbeeDevice and ZigbeeGroup.
15
+
16
+ ### Changed
17
+
18
+ - [package]: Updated dependencies.
19
+
20
+ ### Fixed
21
+
22
+ <a href="https://www.buymeacoffee.com/luligugithub">
23
+ <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
24
+ </a>
25
+
7
26
  ## [2.2.2] - 2024-11-26
8
27
 
9
28
  ### Added
package/dist/entity.d.ts CHANGED
@@ -20,12 +20,18 @@
20
20
  * See the License for the specific language governing permissions and
21
21
  * limitations under the License. *
22
22
  */
23
- import { DeviceTypeDefinition, MatterbridgeDevice, ClusterId, Endpoint, AtLeastOne, EndpointOptions } from 'matterbridge';
23
+ import { DeviceTypeDefinition, MatterbridgeDevice, PowerSource, ClusterId, BridgedDeviceBasicInformation, Endpoint, EndpointOptions, ClusterServerObj, ClusterClientObj, Semtag, AtLeastOne } from 'matterbridge';
24
24
  import { AnsiLogger } from 'matterbridge/logger';
25
25
  import EventEmitter from 'events';
26
26
  import { ZigbeePlatform } from './platform.js';
27
27
  import { BridgeDevice, BridgeGroup } from './zigbee2mqttTypes.js';
28
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
+ */
29
35
  export declare class ZigbeeEntity extends EventEmitter {
30
36
  log: AnsiLogger;
31
37
  serial: string;
@@ -52,32 +58,398 @@ export declare class ZigbeeEntity extends EventEmitter {
52
58
  value_min?: number;
53
59
  value_max?: number;
54
60
  unit?: string;
61
+ category?: string;
62
+ description?: string;
63
+ label?: string;
55
64
  action?: string;
56
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
+ }>;
57
74
  colorTimeout: NodeJS.Timeout | undefined;
58
75
  thermostatTimeout: NodeJS.Timeout | undefined;
76
+ protected composedType: string;
59
77
  protected hasEndpoints: boolean;
60
78
  isRouter: boolean;
61
79
  protected noUpdate: boolean;
62
- createDevice(definition: DeviceTypeDefinition | AtLeastOne<DeviceTypeDefinition>, includeServerList?: ClusterId[], options?: EndpointOptions, debug?: boolean): MatterbridgeDevice;
63
- configure(): void;
64
80
  /**
65
- * Retrieves the value of the specified attribute from the given endpoint and cluster.
81
+ * Creates an instance of ZigbeeEntity.
66
82
  *
67
- * @param {ClusterId} clusterId - The ID of the cluster to retrieve the attribute from.
68
- * @param {string} event - The name of the event to trigger.
69
- * @param {Record<string, any>} payload - The payload of the event to trigger.
70
- * @param {AnsiLogger} [log] - Optional logger for error and info messages.
71
- * @param {Endpoint} [endpoint] - Optional the child endpoint to retrieve the attribute from.
83
+ * @param {ZigbeePlatform} platform - The Zigbee platform instance.
84
+ * @param {BridgeDevice | BridgeGroup} entity - The bridge device or group instance received from zigbee2mqtt.
72
85
  */
73
- triggerEvent(clusterId: ClusterId, event: string, payload: Record<string, any>, log?: AnsiLogger, endpoint?: Endpoint): void;
74
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
+ */
75
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
+ */
76
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
+ */
77
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;
78
426
  }
427
+ /**
428
+ * Represents a Zigbee group entity.
429
+ *
430
+ * @class
431
+ * @extends {ZigbeeEntity}
432
+ */
79
433
  export declare class ZigbeeGroup extends ZigbeeEntity {
80
- constructor(platform: ZigbeePlatform, group: BridgeGroup);
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>;
81
453
  }
82
454
  export interface ZigbeeToMatter {
83
455
  type: string;
@@ -90,7 +462,31 @@ export interface ZigbeeToMatter {
90
462
  valueLookup?: string[];
91
463
  }
92
464
  export declare const z2ms: ZigbeeToMatter[];
465
+ /**
466
+ * Represents a Zigbee device entity.
467
+ *
468
+ * @class
469
+ * @extends {ZigbeeEntity}
470
+ */
93
471
  export declare class ZigbeeDevice extends ZigbeeEntity {
94
- constructor(platform: ZigbeePlatform, device: BridgeDevice);
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>;
95
491
  }
96
492
  //# sourceMappingURL=entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../src/entity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAEL,oBAAoB,EACpB,kBAAkB,EAiBlB,SAAS,EAMT,QAAQ,EACR,UAAU,EAmBV,eAAe,EAGhB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAiG,MAAM,qBAAqB,CAAC;AAIhJ,OAAO,YAAY,MAAM,QAAQ,CAAC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,qBAAa,YAAa,SAAQ,YAAY;IACrC,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,SAAM;IACnB,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC;IAC5B,MAAM,EAAE,YA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