homebridge 2.0.0-beta.30 → 2.0.0-beta.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/api.d.ts +267 -3
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js +92 -0
  4. package/dist/api.js.map +1 -1
  5. package/dist/bridgeService.d.ts +4 -2
  6. package/dist/bridgeService.d.ts.map +1 -1
  7. package/dist/bridgeService.js +1 -3
  8. package/dist/bridgeService.js.map +1 -1
  9. package/dist/childBridgeFork.d.ts +29 -2
  10. package/dist/childBridgeFork.d.ts.map +1 -1
  11. package/dist/childBridgeFork.js +294 -4
  12. package/dist/childBridgeFork.js.map +1 -1
  13. package/dist/childBridgeService.d.ts +19 -0
  14. package/dist/childBridgeService.d.ts.map +1 -1
  15. package/dist/childBridgeService.js +38 -3
  16. package/dist/childBridgeService.js.map +1 -1
  17. package/dist/externalPortService.d.ts +27 -6
  18. package/dist/externalPortService.d.ts.map +1 -1
  19. package/dist/externalPortService.js +73 -7
  20. package/dist/externalPortService.js.map +1 -1
  21. package/dist/index.d.ts +47 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +15 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/ipcService.d.ts +20 -0
  26. package/dist/ipcService.d.ts.map +1 -1
  27. package/dist/ipcService.js.map +1 -1
  28. package/dist/logger.d.ts +6 -0
  29. package/dist/logger.d.ts.map +1 -1
  30. package/dist/logger.js +8 -0
  31. package/dist/logger.js.map +1 -1
  32. package/dist/matter/index.d.ts +123 -0
  33. package/dist/matter/index.d.ts.map +1 -0
  34. package/dist/matter/index.js +19 -0
  35. package/dist/matter/index.js.map +1 -0
  36. package/dist/matter/matterAccessoryCache.d.ts +96 -0
  37. package/dist/matter/matterAccessoryCache.d.ts.map +1 -0
  38. package/dist/matter/matterAccessoryCache.js +192 -0
  39. package/dist/matter/matterAccessoryCache.js.map +1 -0
  40. package/dist/matter/matterBehaviors.d.ts +194 -0
  41. package/dist/matter/matterBehaviors.d.ts.map +1 -0
  42. package/dist/matter/matterBehaviors.js +665 -0
  43. package/dist/matter/matterBehaviors.js.map +1 -0
  44. package/dist/matter/matterConfigValidator.d.ts +81 -0
  45. package/dist/matter/matterConfigValidator.d.ts.map +1 -0
  46. package/dist/matter/matterConfigValidator.js +240 -0
  47. package/dist/matter/matterConfigValidator.js.map +1 -0
  48. package/dist/matter/matterErrorHandler.d.ts +106 -0
  49. package/dist/matter/matterErrorHandler.d.ts.map +1 -0
  50. package/dist/matter/matterErrorHandler.js +495 -0
  51. package/dist/matter/matterErrorHandler.js.map +1 -0
  52. package/dist/matter/matterLogFormatter.d.ts +19 -0
  53. package/dist/matter/matterLogFormatter.d.ts.map +1 -0
  54. package/dist/matter/matterLogFormatter.js +144 -0
  55. package/dist/matter/matterLogFormatter.js.map +1 -0
  56. package/dist/matter/matterNetworkMonitor.d.ts +68 -0
  57. package/dist/matter/matterNetworkMonitor.d.ts.map +1 -0
  58. package/dist/matter/matterNetworkMonitor.js +249 -0
  59. package/dist/matter/matterNetworkMonitor.js.map +1 -0
  60. package/dist/matter/matterServer.d.ts +656 -0
  61. package/dist/matter/matterServer.d.ts.map +1 -0
  62. package/dist/matter/matterServer.js +1692 -0
  63. package/dist/matter/matterServer.js.map +1 -0
  64. package/dist/matter/matterServerHelpers.d.ts +81 -0
  65. package/dist/matter/matterServerHelpers.d.ts.map +1 -0
  66. package/dist/matter/matterServerHelpers.js +323 -0
  67. package/dist/matter/matterServerHelpers.js.map +1 -0
  68. package/dist/matter/matterSharedTypes.d.ts +170 -0
  69. package/dist/matter/matterSharedTypes.d.ts.map +1 -0
  70. package/dist/matter/matterSharedTypes.js +52 -0
  71. package/dist/matter/matterSharedTypes.js.map +1 -0
  72. package/dist/matter/matterStorage.d.ts +128 -0
  73. package/dist/matter/matterStorage.d.ts.map +1 -0
  74. package/dist/matter/matterStorage.js +415 -0
  75. package/dist/matter/matterStorage.js.map +1 -0
  76. package/dist/matter/matterTypes.d.ts +843 -0
  77. package/dist/matter/matterTypes.d.ts.map +1 -0
  78. package/dist/matter/matterTypes.js +222 -0
  79. package/dist/matter/matterTypes.js.map +1 -0
  80. package/dist/server.d.ts +23 -1
  81. package/dist/server.d.ts.map +1 -1
  82. package/dist/server.js +392 -7
  83. package/dist/server.js.map +1 -1
  84. package/dist/user.d.ts +1 -0
  85. package/dist/user.d.ts.map +1 -1
  86. package/dist/user.js +3 -0
  87. package/dist/user.js.map +1 -1
  88. package/package.json +16 -15
@@ -0,0 +1,843 @@
1
+ /**
2
+ * Matter Types for Homebridge Plugin API
3
+ *
4
+ * This module provides types and interfaces for plugin developers
5
+ * to create Matter-compatible accessories.
6
+ */
7
+ import type { Endpoint, EndpointType } from '@matter/main';
8
+ import { EventEmitter } from 'node:events';
9
+ import * as clusters from '@matter/main/clusters';
10
+ import * as devices from '@matter/main/devices';
11
+ export type { EndpointType };
12
+ /**
13
+ * Handler context information
14
+ * Provides information about which part of a composed device triggered the handler
15
+ */
16
+ export interface MatterHandlerContext {
17
+ /** Parent accessory UUID */
18
+ uuid: string;
19
+ /** Part ID if this handler was triggered from a part, undefined for main accessory */
20
+ partId?: string;
21
+ }
22
+ /**
23
+ * Matter command handler function type
24
+ *
25
+ * Handlers can be synchronous or asynchronous (returning a Promise).
26
+ * The args parameter contains the command arguments passed by Matter.js (optional).
27
+ * The context parameter provides information about which part triggered the handler (for composed devices).
28
+ */
29
+ export type MatterCommandHandler<TArgs = unknown> = (args?: TArgs, context?: MatterHandlerContext) => Promise<void> | void;
30
+ /**
31
+ * Matter cluster handlers interface
32
+ *
33
+ * Maps command names to their handler functions.
34
+ * Each command can have custom argument types.
35
+ */
36
+ export interface MatterClusterHandlers {
37
+ [commandName: string]: MatterCommandHandler<any>;
38
+ }
39
+ /**
40
+ * Matter Accessory Part - Sub-device in a composed accessory
41
+ *
42
+ * Represents a child endpoint in a composed device (e.g., individual outlets in a power strip).
43
+ * Parts are added as child endpoints to the main accessory.
44
+ */
45
+ export interface MatterAccessoryPart {
46
+ /** Unique identifier for this part within the accessory (e.g., 'outlet-1', 'light', 'shade') */
47
+ id: string;
48
+ /** Display name for this part (optional, defaults to parent's name + part id) */
49
+ displayName?: string;
50
+ /** Matter device type for this part */
51
+ deviceType: EndpointType;
52
+ /**
53
+ * Initial cluster states for this part
54
+ * Same format as `MatterAccessory.clusters`
55
+ */
56
+ clusters: {
57
+ [clusterName: string]: {
58
+ [attributeName: string]: unknown;
59
+ };
60
+ };
61
+ /**
62
+ * Handlers for this part's commands
63
+ * Handlers receive context.partId to identify which part was triggered
64
+ */
65
+ handlers?: {
66
+ [clusterName: string]: MatterClusterHandlers;
67
+ };
68
+ }
69
+ /**
70
+ * Matter Accessory - Plugin API Interface
71
+ *
72
+ * This is the main interface that plugin developers use to register
73
+ * Matter accessories with Homebridge.
74
+ *
75
+ * For composed devices (devices with multiple subcomponents), use the `parts` array
76
+ * to define child endpoints. Each part appears as a separate device in the Home app.
77
+ */
78
+ export interface MatterAccessory<T = Record<string, unknown>> {
79
+ /** Unique identifier for this accessory (must be unique across all accessories) */
80
+ uuid: string;
81
+ /** Display name for the accessory */
82
+ displayName: string;
83
+ /** Matter device type (e.g., OnOffLightDevice, DimmableLightDevice, etc.) */
84
+ deviceType: EndpointType;
85
+ /** Serial number for the device */
86
+ serialNumber: string;
87
+ /** Manufacturer name */
88
+ manufacturer: string;
89
+ /** Model name/identifier */
90
+ model: string;
91
+ /** Firmware revision (optional) */
92
+ firmwareRevision?: string;
93
+ /** Hardware revision (optional) */
94
+ hardwareRevision?: string;
95
+ /** Software version (optional) */
96
+ softwareVersion?: string;
97
+ /**
98
+ * Plugin developer storage - persists across restarts
99
+ * This is a way for plugin developers to store custom data with their accessory
100
+ * Similar to `PlatformAccessory.context` for HAP accessories
101
+ */
102
+ context?: T;
103
+ /**
104
+ * Initial cluster states
105
+ * Key is the cluster name, value is an object of attribute name -> value
106
+ *
107
+ * Example:
108
+ * {
109
+ * onOff: { onOff: true },
110
+ * levelControl: { currentLevel: 127, minLevel: 1, maxLevel: 254 }
111
+ * }
112
+ *
113
+ * Note: If using `parts`, this is optional (main accessory may only be a container)
114
+ */
115
+ clusters?: {
116
+ [clusterName: string]: {
117
+ [attributeName: string]: unknown;
118
+ };
119
+ };
120
+ /**
121
+ * Handlers for Matter commands (Home app → Device)
122
+ *
123
+ * These handlers are called when a user controls the accessory via the Home app.
124
+ * Use handlers to send commands to your actual device (cloud API, local network, etc.).
125
+ */
126
+ handlers?: {
127
+ [clusterName: string]: MatterClusterHandlers;
128
+ };
129
+ /**
130
+ * Optional: Get current state handler
131
+ * Called when a Matter controller reads an attribute
132
+ * If not provided, the last set value is returned
133
+ */
134
+ getState?: (cluster: string, attribute: string) => Promise<any> | any;
135
+ /**
136
+ * Optional: Array of child endpoints (parts) for composed devices
137
+ *
138
+ * Use this to create devices with multiple independent subcomponents, such as:
139
+ * - Power strip with multiple outlets
140
+ * - Window covering with shade + light
141
+ * - Multi-zone thermostat or speaker system
142
+ *
143
+ * Each part appears as a separate device in the Home app and can be controlled independently.
144
+ *
145
+ * Example:
146
+ * ```typescript
147
+ * parts: [
148
+ * {
149
+ * id: 'outlet-1',
150
+ * displayName: 'Outlet 1',
151
+ * deviceType: api.matter.deviceTypes.OnOffOutlet,
152
+ * clusters: { onOff: { onOff: false } },
153
+ * handlers: {
154
+ * onOff: {
155
+ * on: async (args, context) => {
156
+ * console.log(`Part ${context.partId} turned on`)
157
+ * await controlOutlet(1, true)
158
+ * }
159
+ * }
160
+ * }
161
+ * },
162
+ * // ... more outlets
163
+ * ]
164
+ * ```
165
+ */
166
+ parts?: MatterAccessoryPart[];
167
+ }
168
+ /**
169
+ * Matter Configuration (for bridge or child bridge)
170
+ */
171
+ export interface MatterConfig extends Record<string, unknown> {
172
+ /** Port for Matter server (optional, will auto-assign if not specified) */
173
+ port?: number;
174
+ /** Name for the Matter bridge (optional) */
175
+ name?: string;
176
+ }
177
+ /**
178
+ * Matter Fabric Information
179
+ * Represents a commissioned controller (fabric) on the Matter bridge
180
+ */
181
+ export interface MatterFabricInfo {
182
+ fabricIndex: number;
183
+ fabricId: string;
184
+ nodeId: string;
185
+ rootVendorId: number;
186
+ label?: string;
187
+ }
188
+ /**
189
+ * Matter Server Events
190
+ * Event types emitted by the Matter server for commissioning lifecycle
191
+ */
192
+ export interface MatterServerEvents {
193
+ /** Emitted when the bridge is commissioned for the first time */
194
+ 'commissioned': (fabricInfo: MatterFabricInfo) => void;
195
+ /** Emitted when the last fabric is removed (bridge becomes uncommissioned) */
196
+ 'decommissioned': () => void;
197
+ /** Emitted when a new fabric (controller) is added */
198
+ 'fabric-added': (fabricInfo: MatterFabricInfo) => void;
199
+ /** Emitted when a fabric (controller) is removed */
200
+ 'fabric-removed': (fabricInfo: MatterFabricInfo) => void;
201
+ /** Emitted whenever commissioning state changes (any fabric added/removed) */
202
+ 'commissioning-changed': (commissioned: boolean, fabricCount: number) => void;
203
+ /** Emitted when an accessory is registered */
204
+ 'accessory-registered': (accessory: MatterAccessory) => void;
205
+ /** Emitted when an accessory is unregistered */
206
+ 'accessory-unregistered': (uuid: string) => void;
207
+ }
208
+ /**
209
+ * Matter Accessory Event Types
210
+ *
211
+ * Events that can be emitted by Matter accessories during their lifecycle.
212
+ * These events follow the same pattern as HAP's AccessoryEventTypes to provide
213
+ * a consistent plugin development experience across both protocols.
214
+ *
215
+ * @example
216
+ * ```typescript
217
+ * Listen for when a Matter accessory is ready
218
+ * const accessory: MatterAccessory = { ... };
219
+ * api.matter.publishExternalAccessories('plugin-name', [accessory]);
220
+ *
221
+ * const internal = accessory as any;
222
+ * internal._eventEmitter?.on(MatterAccessoryEventTypes.READY, (port: number) => {
223
+ * console.log(`Accessory ready on port ${port}`);
224
+ * });
225
+ * ```
226
+ *
227
+ * @group Matter Accessory
228
+ */
229
+ export declare enum MatterAccessoryEventTypes {
230
+ /**
231
+ * Emitted when the Matter server is ready and the accessory is available on the network.
232
+ * This is the main event to listen for to know when an external accessory is ready.
233
+ *
234
+ * **HAP Equivalent:** `AccessoryEventTypes.ADVERTISED`
235
+ *
236
+ * @param port - The port number the Matter server is listening on
237
+ */
238
+ READY = "ready",
239
+ /**
240
+ * Emitted when a controller has commissioned (paired with) this accessory.
241
+ * This means a user has successfully added the accessory to their Matter controller
242
+ * (e.g., Apple Home, Google Home, Amazon Alexa).
243
+ *
244
+ * **HAP Equivalent:** `AccessoryEventTypes.PAIRED`
245
+ */
246
+ COMMISSIONED = "commissioned",
247
+ /**
248
+ * Emitted when a controller has decommissioned (unpaired from) this accessory.
249
+ * This typically happens when a user removes the accessory from their controller app.
250
+ *
251
+ * **HAP Equivalent:** `AccessoryEventTypes.UNPAIRED`
252
+ */
253
+ DECOMMISSIONED = "decommissioned"
254
+ }
255
+ /**
256
+ * Matter Accessory Event Emitter Interface
257
+ *
258
+ * Defines the typed event emitter interface for Matter accessories.
259
+ * This interface extends Node's EventEmitter to provide type-safe event handling
260
+ * for Matter accessory lifecycle events.
261
+ *
262
+ * **Usage Pattern (similar to HAP):**
263
+ * ```typescript
264
+ * const accessory: MatterAccessory = { ... };
265
+ * api.matter.publishExternalAccessories('plugin-name', [accessory]);
266
+ *
267
+ * Access the event emitter (note: created during registration)
268
+ * const internal = accessory as InternalMatterAccessory;
269
+ * internal._eventEmitter?.on(MatterAccessoryEventTypes.READY, (port: number) => {
270
+ * console.log(`Accessory ready on port ${port}`);
271
+ * });
272
+ * ```
273
+ *
274
+ * @group Matter Accessory
275
+ */
276
+ export interface MatterAccessoryEventEmitter extends EventEmitter {
277
+ /** Register listener for 'ready' event (fired when accessory is available on network) */
278
+ on: ((event: 'ready', listener: (port: number) => void) => this) & ((event: 'commissioned', listener: () => void) => this) & ((event: 'decommissioned', listener: () => void) => this);
279
+ /** Emit 'ready', 'commissioned', or 'decommissioned' event */
280
+ emit: ((event: 'ready', port: number) => boolean) & ((event: 'commissioned') => boolean) & ((event: 'decommissioned') => boolean);
281
+ }
282
+ /**
283
+ * Internal representation of a part endpoint
284
+ */
285
+ export interface InternalMatterAccessoryPart extends MatterAccessoryPart {
286
+ /** Matter.js endpoint instance for this part */
287
+ endpoint?: Endpoint;
288
+ }
289
+ /**
290
+ * Internal Matter accessory representation
291
+ * (Used internally by MatterServer)
292
+ *
293
+ * @internal
294
+ */
295
+ export interface InternalMatterAccessory extends MatterAccessory {
296
+ /** Plugin identifier (set when registered) */
297
+ _associatedPlugin?: string;
298
+ /** Platform name (set when registered) */
299
+ _associatedPlatform?: string;
300
+ /** Matter.js endpoint instance */
301
+ endpoint?: Endpoint;
302
+ /** Whether this accessory is currently registered */
303
+ registered: boolean;
304
+ /** Internal part endpoints (if using parts) */
305
+ _parts?: InternalMatterAccessoryPart[];
306
+ /**
307
+ * Event emitter for accessory lifecycle events (ready, commissioned, decommissioned).
308
+ *
309
+ * Created during accessory registration. Plugins can listen to these events to know
310
+ * when an external accessory is available on the network.
311
+ *
312
+ * **HAP Equivalent:** Similar to `PlatformAccessory._associatedHAPAccessory` events
313
+ *
314
+ * @example
315
+ * ```typescript
316
+ * const accessory: MatterAccessory = { ... };
317
+ * api.matter.publishExternalAccessories('plugin', [accessory]);
318
+ *
319
+ * Cast to internal type to access event emitter
320
+ * const internal = accessory as InternalMatterAccessory;
321
+ * internal._eventEmitter?.on(MatterAccessoryEventTypes.READY, (port) => {
322
+ * console.log(`Accessory ready on port ${port}`);
323
+ * });
324
+ * ```
325
+ */
326
+ _eventEmitter?: MatterAccessoryEventEmitter;
327
+ }
328
+ /**
329
+ * Matter error type enum (for error handler categorization)
330
+ */
331
+ export declare enum MatterErrorType {
332
+ INITIALIZATION = "INITIALIZATION",
333
+ NETWORK = "NETWORK",
334
+ COMMISSIONING = "COMMISSIONING",
335
+ DEVICE_SYNC = "DEVICE_SYNC",
336
+ SERVER = "SERVER",
337
+ STORAGE = "STORAGE",
338
+ CONFIGURATION = "CONFIGURATION",
339
+ DEVICE_ERROR = "DEVICE_ERROR",
340
+ UNKNOWN = "UNKNOWN"
341
+ }
342
+ /**
343
+ * Matter error details interface
344
+ */
345
+ export interface MatterErrorDetails {
346
+ type?: MatterErrorType;
347
+ recoverable?: boolean;
348
+ code?: string;
349
+ context?: string;
350
+ originalError?: Error;
351
+ }
352
+ /**
353
+ * Matter error types
354
+ */
355
+ export declare class MatterError extends Error {
356
+ readonly code: string;
357
+ readonly details?: MatterErrorDetails | undefined;
358
+ readonly type: MatterErrorType;
359
+ readonly timestamp: Date;
360
+ readonly recoverable: boolean;
361
+ constructor(message: string, code: string, details?: MatterErrorDetails | undefined);
362
+ }
363
+ export declare class MatterCommissioningError extends MatterError {
364
+ constructor(message: string, details?: MatterErrorDetails);
365
+ }
366
+ export declare class MatterStorageError extends MatterError {
367
+ constructor(message: string, details?: MatterErrorDetails);
368
+ }
369
+ export declare class MatterDeviceError extends MatterError {
370
+ constructor(message: string, details?: MatterErrorDetails);
371
+ }
372
+ export declare class MatterNetworkError extends MatterError {
373
+ constructor(message: string, details?: MatterErrorDetails);
374
+ }
375
+ export { clusters };
376
+ export { devices };
377
+ /**
378
+ * Friendly device type names for the Plugin API
379
+ * Maps simplified names to actual Matter.js device types
380
+ */
381
+ export declare const deviceTypes: {
382
+ readonly OnOffLight: devices.OnOffLightDevice;
383
+ readonly DimmableLight: devices.DimmableLightDevice;
384
+ readonly ColorTemperatureLight: devices.ColorTemperatureLightDevice;
385
+ readonly ExtendedColorLight: devices.ExtendedColorLightDevice;
386
+ readonly OnOffSwitch: devices.OnOffLightSwitchDevice;
387
+ readonly OnOffOutlet: devices.OnOffPlugInUnitDevice;
388
+ readonly DimmableOutlet: devices.DimmablePlugInUnitDevice;
389
+ readonly TemperatureSensor: devices.TemperatureSensorDevice;
390
+ readonly HumiditySensor: devices.HumiditySensorDevice;
391
+ readonly LightSensor: devices.LightSensorDevice;
392
+ readonly MotionSensor: devices.OccupancySensorDevice;
393
+ readonly ContactSensor: devices.ContactSensorDevice;
394
+ readonly LeakSensor: devices.WaterLeakDetectorDevice;
395
+ readonly SmokeSensor: devices.SmokeCoAlarmDevice;
396
+ readonly Thermostat: import("@matter/main").MutableEndpoint.With<EndpointType.For<{
397
+ readonly name: "Thermostat";
398
+ readonly deviceType: 769;
399
+ readonly deviceRevision: 4;
400
+ readonly requirements: typeof devices.ThermostatRequirements;
401
+ readonly behaviors: {
402
+ readonly identify: typeof import("@matter/node/behaviors").IdentifyServer;
403
+ };
404
+ }>, import("@matter/main").SupportedBehaviors.With<{
405
+ readonly identify: typeof import("@matter/node/behaviors").IdentifyServer;
406
+ }, readonly [import("@matter/main").ClusterBehavior.Type<import("@matter/types").ClusterComposer.WithFeatures<import("@matter/types").ClusterType.Of<{
407
+ readonly id: 513;
408
+ readonly name: "Thermostat";
409
+ readonly revision: 8;
410
+ readonly features: {
411
+ readonly heating: import("@matter/types").BitFlag;
412
+ readonly cooling: import("@matter/types").BitFlag;
413
+ readonly occupancy: import("@matter/types").BitFlag;
414
+ readonly scheduleConfiguration: import("@matter/types").BitFlag;
415
+ readonly setback: import("@matter/types").BitFlag;
416
+ readonly autoMode: import("@matter/types").BitFlag;
417
+ readonly localTemperatureNotExposed: import("@matter/types").BitFlag;
418
+ readonly matterScheduleConfiguration: import("@matter/types").BitFlag;
419
+ readonly presets: import("@matter/types").BitFlag;
420
+ };
421
+ readonly attributes: {
422
+ readonly localTemperature: import("@matter/types").Attribute<number | null, any>;
423
+ readonly outdoorTemperature: import("@matter/types").OptionalAttribute<number | null, any>;
424
+ readonly hvacSystemTypeConfiguration: import("@matter/types").OptionalWritableAttribute<import("@matter/types").TypeFromPartialBitSchema<{
425
+ coolingStage: import("@matter/types").BitField;
426
+ heatingStage: import("@matter/types").BitField;
427
+ heatingIsHeatPump: import("@matter/types").BitFlag;
428
+ heatingUsesFuel: import("@matter/types").BitFlag;
429
+ }>, any>;
430
+ readonly remoteSensing: import("@matter/types").OptionalWritableAttribute<import("@matter/types").TypeFromPartialBitSchema<{
431
+ localTemperature: import("@matter/types").BitFlag;
432
+ outdoorTemperature: import("@matter/types").BitFlag;
433
+ occupancy: import("@matter/types").BitFlag;
434
+ }>, any>;
435
+ readonly controlSequenceOfOperation: import("@matter/types").WritableAttribute<clusters.Thermostat.ControlSequenceOfOperation, any>;
436
+ readonly systemMode: import("@matter/types").WritableAttribute<clusters.Thermostat.SystemMode, any>;
437
+ readonly temperatureSetpointHold: import("@matter/types").OptionalWritableAttribute<clusters.Thermostat.TemperatureSetpointHold, any>;
438
+ readonly temperatureSetpointHoldDuration: import("@matter/types").OptionalWritableAttribute<number | null, any>;
439
+ readonly thermostatProgrammingOperationMode: import("@matter/types").OptionalWritableAttribute<import("@matter/types").TypeFromPartialBitSchema<{
440
+ scheduleActive: import("@matter/types").BitFlag;
441
+ autoRecovery: import("@matter/types").BitFlag;
442
+ economy: import("@matter/types").BitFlag;
443
+ }>, any>;
444
+ readonly thermostatRunningState: import("@matter/types").OptionalAttribute<import("@matter/types").TypeFromPartialBitSchema<{
445
+ heat: import("@matter/types").BitFlag;
446
+ cool: import("@matter/types").BitFlag;
447
+ fan: import("@matter/types").BitFlag;
448
+ heatStage2: import("@matter/types").BitFlag;
449
+ coolStage2: import("@matter/types").BitFlag;
450
+ fanStage2: import("@matter/types").BitFlag;
451
+ fanStage3: import("@matter/types").BitFlag;
452
+ }>, any>;
453
+ readonly setpointChangeSource: import("@matter/types").OptionalAttribute<clusters.Thermostat.SetpointChangeSource, any>;
454
+ readonly setpointChangeAmount: import("@matter/types").OptionalAttribute<number | null, any>;
455
+ readonly setpointChangeSourceTimestamp: import("@matter/types").OptionalAttribute<number, any>;
456
+ readonly emergencyHeatDelta: import("@matter/types").OptionalWritableAttribute<number, any>;
457
+ readonly acType: import("@matter/types").OptionalWritableAttribute<clusters.Thermostat.AcType, any>;
458
+ readonly acCapacity: import("@matter/types").OptionalWritableAttribute<number, any>;
459
+ readonly acRefrigerantType: import("@matter/types").OptionalWritableAttribute<clusters.Thermostat.AcRefrigerantType, any>;
460
+ readonly acCompressorType: import("@matter/types").OptionalWritableAttribute<clusters.Thermostat.AcCompressorType, any>;
461
+ readonly acErrorCode: import("@matter/types").OptionalWritableAttribute<import("@matter/types").TypeFromPartialBitSchema<{
462
+ compressorFail: import("@matter/types").BitFlag;
463
+ roomSensorFail: import("@matter/types").BitFlag;
464
+ outdoorSensorFail: import("@matter/types").BitFlag;
465
+ coilSensorFail: import("@matter/types").BitFlag;
466
+ fanFail: import("@matter/types").BitFlag;
467
+ }>, any>;
468
+ readonly acLouverPosition: import("@matter/types").OptionalWritableAttribute<clusters.Thermostat.AcLouverPosition, any>;
469
+ readonly acCoilTemperature: import("@matter/types").OptionalAttribute<number | null, any>;
470
+ readonly acCapacityFormat: import("@matter/types").OptionalWritableAttribute<clusters.Thermostat.AcCapacityFormat, any>;
471
+ readonly setpointHoldExpiryTimestamp: import("@matter/types").OptionalAttribute<number | null, any>;
472
+ };
473
+ readonly commands: {
474
+ readonly setpointRaiseLower: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
475
+ mode: import("@matter/types").FieldType<clusters.Thermostat.SetpointRaiseLowerMode>;
476
+ amount: import("@matter/types").FieldType<number>;
477
+ }>, void, any>;
478
+ };
479
+ readonly extensions: readonly [{
480
+ readonly flags: {
481
+ readonly occupancy: true;
482
+ };
483
+ readonly component: {
484
+ readonly attributes: {
485
+ readonly occupancy: import("@matter/types").Attribute<import("@matter/types").TypeFromPartialBitSchema<{
486
+ occupied: import("@matter/types").BitFlag;
487
+ }>, any>;
488
+ };
489
+ };
490
+ }, {
491
+ readonly flags: {
492
+ readonly heating: true;
493
+ };
494
+ readonly component: {
495
+ readonly attributes: {
496
+ readonly absMinHeatSetpointLimit: import("@matter/types").OptionalFixedAttribute<number, any>;
497
+ readonly absMaxHeatSetpointLimit: import("@matter/types").OptionalFixedAttribute<number, any>;
498
+ readonly piHeatingDemand: import("@matter/types").OptionalAttribute<number, any>;
499
+ readonly occupiedHeatingSetpoint: import("@matter/types").WritableAttribute<number, any>;
500
+ readonly minHeatSetpointLimit: import("@matter/types").OptionalWritableAttribute<number, any>;
501
+ readonly maxHeatSetpointLimit: import("@matter/types").OptionalWritableAttribute<number, any>;
502
+ };
503
+ };
504
+ }, {
505
+ readonly flags: {
506
+ readonly cooling: true;
507
+ };
508
+ readonly component: {
509
+ readonly attributes: {
510
+ readonly absMinCoolSetpointLimit: import("@matter/types").OptionalFixedAttribute<number, any>;
511
+ readonly absMaxCoolSetpointLimit: import("@matter/types").OptionalFixedAttribute<number, any>;
512
+ readonly piCoolingDemand: import("@matter/types").OptionalAttribute<number, any>;
513
+ readonly occupiedCoolingSetpoint: import("@matter/types").WritableAttribute<number, any>;
514
+ readonly minCoolSetpointLimit: import("@matter/types").OptionalWritableAttribute<number, any>;
515
+ readonly maxCoolSetpointLimit: import("@matter/types").OptionalWritableAttribute<number, any>;
516
+ };
517
+ };
518
+ }, {
519
+ readonly flags: {
520
+ readonly localTemperatureNotExposed: false;
521
+ };
522
+ readonly component: {
523
+ readonly attributes: {
524
+ readonly localTemperatureCalibration: import("@matter/types").OptionalWritableAttribute<number, any>;
525
+ };
526
+ };
527
+ }, {
528
+ readonly flags: {
529
+ readonly cooling: true;
530
+ readonly occupancy: true;
531
+ };
532
+ readonly component: {
533
+ readonly attributes: {
534
+ readonly unoccupiedCoolingSetpoint: import("@matter/types").WritableAttribute<number, any>;
535
+ };
536
+ };
537
+ }, {
538
+ readonly flags: {
539
+ readonly heating: true;
540
+ readonly occupancy: true;
541
+ };
542
+ readonly component: {
543
+ readonly attributes: {
544
+ readonly unoccupiedHeatingSetpoint: import("@matter/types").WritableAttribute<number, any>;
545
+ };
546
+ };
547
+ }, {
548
+ readonly flags: {
549
+ readonly autoMode: true;
550
+ };
551
+ readonly component: {
552
+ readonly attributes: {
553
+ readonly minSetpointDeadBand: import("@matter/types").WritableAttribute<number, any>;
554
+ readonly thermostatRunningMode: import("@matter/types").OptionalAttribute<clusters.Thermostat.ThermostatRunningMode, any>;
555
+ };
556
+ };
557
+ }, {
558
+ readonly flags: {
559
+ readonly scheduleConfiguration: true;
560
+ };
561
+ readonly component: {
562
+ readonly attributes: {
563
+ readonly startOfWeek: import("@matter/types").FixedAttribute<clusters.Thermostat.StartOfWeek, any>;
564
+ readonly numberOfWeeklyTransitions: import("@matter/types").FixedAttribute<number, any>;
565
+ readonly numberOfDailyTransitions: import("@matter/types").FixedAttribute<number, any>;
566
+ };
567
+ readonly commands: {
568
+ readonly setWeeklySchedule: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
569
+ numberOfTransitionsForSequence: import("@matter/types").FieldType<number>;
570
+ dayOfWeekForSequence: import("@matter/types").FieldType<import("@matter/types").TypeFromPartialBitSchema<{
571
+ sunday: import("@matter/types").BitFlag;
572
+ monday: import("@matter/types").BitFlag;
573
+ tuesday: import("@matter/types").BitFlag;
574
+ wednesday: import("@matter/types").BitFlag;
575
+ thursday: import("@matter/types").BitFlag;
576
+ friday: import("@matter/types").BitFlag;
577
+ saturday: import("@matter/types").BitFlag;
578
+ away: import("@matter/types").BitFlag;
579
+ }>>;
580
+ modeForSequence: import("@matter/types").FieldType<import("@matter/types").TypeFromPartialBitSchema<{
581
+ heatSetpointPresent: import("@matter/types").BitFlag;
582
+ coolSetpointPresent: import("@matter/types").BitFlag;
583
+ }>>;
584
+ transitions: import("@matter/types").FieldType<import("@matter/types").TypeFromFields<{
585
+ transitionTime: import("@matter/types").FieldType<number>;
586
+ heatSetpoint: import("@matter/types").FieldType<number | null>;
587
+ coolSetpoint: import("@matter/types").FieldType<number | null>;
588
+ }>[]>;
589
+ }>, void, any>;
590
+ readonly getWeeklySchedule: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
591
+ daysToReturn: import("@matter/types").FieldType<import("@matter/types").TypeFromPartialBitSchema<{
592
+ sunday: import("@matter/types").BitFlag;
593
+ monday: import("@matter/types").BitFlag;
594
+ tuesday: import("@matter/types").BitFlag;
595
+ wednesday: import("@matter/types").BitFlag;
596
+ thursday: import("@matter/types").BitFlag;
597
+ friday: import("@matter/types").BitFlag;
598
+ saturday: import("@matter/types").BitFlag;
599
+ away: import("@matter/types").BitFlag;
600
+ }>>;
601
+ modeToReturn: import("@matter/types").FieldType<import("@matter/types").TypeFromPartialBitSchema<{
602
+ heatSetpointPresent: import("@matter/types").BitFlag;
603
+ coolSetpointPresent: import("@matter/types").BitFlag;
604
+ }>>;
605
+ }>, import("@matter/types").TypeFromFields<{
606
+ numberOfTransitionsForSequence: import("@matter/types").FieldType<number>;
607
+ dayOfWeekForSequence: import("@matter/types").FieldType<import("@matter/types").TypeFromPartialBitSchema<{
608
+ sunday: import("@matter/types").BitFlag;
609
+ monday: import("@matter/types").BitFlag;
610
+ tuesday: import("@matter/types").BitFlag;
611
+ wednesday: import("@matter/types").BitFlag;
612
+ thursday: import("@matter/types").BitFlag;
613
+ friday: import("@matter/types").BitFlag;
614
+ saturday: import("@matter/types").BitFlag;
615
+ away: import("@matter/types").BitFlag;
616
+ }>>;
617
+ modeForSequence: import("@matter/types").FieldType<import("@matter/types").TypeFromPartialBitSchema<{
618
+ heatSetpointPresent: import("@matter/types").BitFlag;
619
+ coolSetpointPresent: import("@matter/types").BitFlag;
620
+ }>>;
621
+ transitions: import("@matter/types").FieldType<import("@matter/types").TypeFromFields<{
622
+ transitionTime: import("@matter/types").FieldType<number>;
623
+ heatSetpoint: import("@matter/types").FieldType<number | null>;
624
+ coolSetpoint: import("@matter/types").FieldType<number | null>;
625
+ }>[]>;
626
+ }>, any>;
627
+ readonly clearWeeklySchedule: import("@matter/types").Command<void, void, any>;
628
+ };
629
+ };
630
+ }, {
631
+ readonly flags: {
632
+ readonly setback: true;
633
+ };
634
+ readonly component: {
635
+ readonly attributes: {
636
+ readonly occupiedSetback: import("@matter/types").WritableAttribute<number | null, any>;
637
+ readonly occupiedSetbackMin: import("@matter/types").FixedAttribute<number | null, any>;
638
+ readonly occupiedSetbackMax: import("@matter/types").FixedAttribute<number | null, any>;
639
+ };
640
+ };
641
+ }, {
642
+ readonly flags: {
643
+ readonly setback: true;
644
+ readonly occupancy: true;
645
+ };
646
+ readonly component: {
647
+ readonly attributes: {
648
+ readonly unoccupiedSetback: import("@matter/types").WritableAttribute<number | null, any>;
649
+ readonly unoccupiedSetbackMin: import("@matter/types").FixedAttribute<number | null, any>;
650
+ readonly unoccupiedSetbackMax: import("@matter/types").FixedAttribute<number | null, any>;
651
+ };
652
+ };
653
+ }, {
654
+ readonly flags: {
655
+ readonly presets: true;
656
+ };
657
+ readonly component: {
658
+ readonly attributes: {
659
+ readonly presetTypes: import("@matter/types").FixedAttribute<import("@matter/types").TypeFromFields<{
660
+ presetScenario: import("@matter/types").FieldType<clusters.Thermostat.PresetScenario>;
661
+ numberOfPresets: import("@matter/types").FieldType<number>;
662
+ presetTypeFeatures: import("@matter/types").FieldType<import("@matter/types").TypeFromPartialBitSchema<{
663
+ automatic: import("@matter/types").BitFlag;
664
+ supportsNames: import("@matter/types").BitFlag;
665
+ }>>;
666
+ }>[], any>;
667
+ readonly numberOfPresets: import("@matter/types").FixedAttribute<number, any>;
668
+ readonly activePresetHandle: import("@matter/types").Attribute<AllowSharedBufferSource | null, any>;
669
+ readonly presets: import("@matter/types").WritableAttribute<import("@matter/types").TypeFromFields<{
670
+ presetHandle: import("@matter/types").FieldType<AllowSharedBufferSource | null>;
671
+ presetScenario: import("@matter/types").FieldType<clusters.Thermostat.PresetScenario>;
672
+ name: import("@matter/types").OptionalFieldType<string | null>;
673
+ coolingSetpoint: import("@matter/types").OptionalFieldType<number>;
674
+ heatingSetpoint: import("@matter/types").OptionalFieldType<number>;
675
+ builtIn: import("@matter/types").FieldType<boolean | null>;
676
+ }>[], any>;
677
+ };
678
+ readonly commands: {
679
+ readonly setActivePresetRequest: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
680
+ presetHandle: import("@matter/types").FieldType<AllowSharedBufferSource | null>;
681
+ }>, void, any>;
682
+ };
683
+ };
684
+ }, {
685
+ readonly flags: {
686
+ readonly matterScheduleConfiguration: true;
687
+ };
688
+ readonly component: {
689
+ readonly attributes: {
690
+ readonly scheduleTypes: import("@matter/types").FixedAttribute<import("@matter/types").TypeFromFields<{
691
+ systemMode: import("@matter/types").FieldType<clusters.Thermostat.SystemMode>;
692
+ numberOfSchedules: import("@matter/types").FieldType<number>;
693
+ scheduleTypeFeatures: import("@matter/types").FieldType<import("@matter/types").TypeFromPartialBitSchema<{
694
+ supportsPresets: import("@matter/types").BitFlag;
695
+ supportsSetpoints: import("@matter/types").BitFlag;
696
+ supportsNames: import("@matter/types").BitFlag;
697
+ supportsOff: import("@matter/types").BitFlag;
698
+ }>>;
699
+ }>[], any>;
700
+ readonly numberOfSchedules: import("@matter/types").FixedAttribute<number, any>;
701
+ readonly numberOfScheduleTransitions: import("@matter/types").FixedAttribute<number, any>;
702
+ readonly numberOfScheduleTransitionPerDay: import("@matter/types").FixedAttribute<number | null, any>;
703
+ readonly activeScheduleHandle: import("@matter/types").Attribute<AllowSharedBufferSource | null, any>;
704
+ readonly schedules: import("@matter/types").WritableAttribute<import("@matter/types").TypeFromFields<{
705
+ scheduleHandle: import("@matter/types").FieldType<AllowSharedBufferSource | null>;
706
+ systemMode: import("@matter/types").FieldType<clusters.Thermostat.SystemMode>;
707
+ name: import("@matter/types").OptionalFieldType<string>;
708
+ presetHandle: import("@matter/types").OptionalFieldType<AllowSharedBufferSource>;
709
+ transitions: import("@matter/types").FieldType<import("@matter/types").TypeFromFields<{
710
+ dayOfWeek: import("@matter/types").FieldType<import("@matter/types").TypeFromPartialBitSchema<{
711
+ sunday: import("@matter/types").BitFlag;
712
+ monday: import("@matter/types").BitFlag;
713
+ tuesday: import("@matter/types").BitFlag;
714
+ wednesday: import("@matter/types").BitFlag;
715
+ thursday: import("@matter/types").BitFlag;
716
+ friday: import("@matter/types").BitFlag;
717
+ saturday: import("@matter/types").BitFlag;
718
+ away: import("@matter/types").BitFlag;
719
+ }>>;
720
+ transitionTime: import("@matter/types").FieldType<number>;
721
+ presetHandle: import("@matter/types").OptionalFieldType<AllowSharedBufferSource>;
722
+ systemMode: import("@matter/types").OptionalFieldType<clusters.Thermostat.SystemMode>;
723
+ coolingSetpoint: import("@matter/types").OptionalFieldType<number>;
724
+ heatingSetpoint: import("@matter/types").OptionalFieldType<number>;
725
+ }>[]>;
726
+ builtIn: import("@matter/types").FieldType<boolean | null>;
727
+ }>[], any>;
728
+ };
729
+ readonly commands: {
730
+ readonly setActiveScheduleRequest: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
731
+ scheduleHandle: import("@matter/types").FieldType<AllowSharedBufferSource>;
732
+ }>, void, any>;
733
+ };
734
+ };
735
+ }, {
736
+ readonly flags: {
737
+ readonly autoMode: true;
738
+ readonly heating: false;
739
+ };
740
+ readonly component: false;
741
+ }, {
742
+ readonly flags: {
743
+ readonly autoMode: true;
744
+ readonly cooling: false;
745
+ };
746
+ readonly component: false;
747
+ }, {
748
+ readonly flags: {
749
+ readonly heating: false;
750
+ readonly cooling: false;
751
+ };
752
+ readonly component: false;
753
+ }];
754
+ }>, readonly ["Heating", "Cooling"]>, typeof import("@matter/node/behaviors").ThermostatServer, import("@matter/node/behaviors").ThermostatInterface>]>>;
755
+ readonly Fan: devices.FanDevice;
756
+ readonly DoorLock: devices.DoorLockDevice;
757
+ readonly WindowCovering: devices.WindowCoveringDevice;
758
+ readonly RoboticVacuumCleaner: devices.RoboticVacuumCleanerDevice;
759
+ readonly GenericSwitch: devices.GenericSwitchDevice;
760
+ readonly Pump: devices.PumpDevice;
761
+ readonly RoomAirConditioner: devices.RoomAirConditionerDevice;
762
+ };
763
+ /**
764
+ * Matter Cluster Names
765
+ * Commonly used cluster names for type safety and autocomplete
766
+ * Use these with api.updateMatterAccessoryState() and api.getAccessoryState()
767
+ *
768
+ * @example
769
+ * ```typescript
770
+ * With autocomplete and type safety:
771
+ * api.updateMatterAccessoryState(uuid, api.matterClusterNames.OnOff, { onOff: true })
772
+ * api.getAccessoryState(uuid, api.matterClusterNames.LevelControl)
773
+ * ```
774
+ */
775
+ export declare const clusterNames: {
776
+ readonly OnOff: "onOff";
777
+ readonly LevelControl: "levelControl";
778
+ readonly ColorControl: "colorControl";
779
+ readonly DoorLock: "doorLock";
780
+ readonly WindowCovering: "windowCovering";
781
+ readonly Thermostat: "thermostat";
782
+ readonly FanControl: "fanControl";
783
+ readonly TemperatureMeasurement: "temperatureMeasurement";
784
+ readonly RelativeHumidityMeasurement: "relativeHumidityMeasurement";
785
+ readonly IlluminanceMeasurement: "illuminanceMeasurement";
786
+ readonly OccupancySensing: "occupancySensing";
787
+ readonly BooleanState: "booleanState";
788
+ readonly SmokeCoAlarm: "smokeCoAlarm";
789
+ readonly RvcRunMode: "rvcRunMode";
790
+ readonly RvcOperationalState: "rvcOperationalState";
791
+ readonly RvcCleanMode: "rvcCleanMode";
792
+ readonly ServiceArea: "serviceArea";
793
+ readonly PumpConfigurationAndControl: "pumpConfigurationAndControl";
794
+ readonly Identify: "identify";
795
+ readonly BasicInformation: "basicInformation";
796
+ readonly BridgedDeviceBasicInformation: "bridgedDeviceBasicInformation";
797
+ };
798
+ /**
799
+ * Type for Matter cluster names
800
+ * Provides type safety for cluster name strings
801
+ */
802
+ export type MatterClusterName = typeof clusterNames[keyof typeof clusterNames];
803
+ /**
804
+ * Type-safe accessory map for MatterServer
805
+ */
806
+ export type MatterAccessoryMap = Map<string, InternalMatterAccessory>;
807
+ /**
808
+ * Check if endpoint has state property (runtime check)
809
+ */
810
+ export declare function hasEndpointState(endpoint: Endpoint): boolean;
811
+ /**
812
+ * Safely update endpoint state
813
+ * Uses the Endpoint's set method to update cluster attributes
814
+ */
815
+ export declare function updateEndpointState(endpoint: Endpoint, cluster: string, attributes: Record<string, unknown>): Promise<void>;
816
+ /**
817
+ * Device type with behaviors (internal Matter.js structure)
818
+ */
819
+ export interface DeviceTypeWithBehaviors extends EndpointType {
820
+ with: (...behaviors: any[]) => DeviceTypeWithBehaviors;
821
+ }
822
+ /**
823
+ * WindowCovering cluster with dynamic attributes
824
+ */
825
+ export interface WindowCoveringCluster {
826
+ type?: number;
827
+ configStatus?: {
828
+ liftPositionAware?: boolean;
829
+ tiltPositionAware?: boolean;
830
+ liftEncoderControlled?: boolean;
831
+ tiltEncoderControlled?: boolean;
832
+ };
833
+ targetPositionLiftPercent100ths?: number;
834
+ currentPositionLiftPercent100ths?: number;
835
+ targetPositionTiltPercent100ths?: number;
836
+ currentPositionTiltPercent100ths?: number;
837
+ operationalStatus?: number;
838
+ }
839
+ /**
840
+ * Type-safe cluster access for WindowCovering
841
+ */
842
+ export declare function getWindowCoveringCluster(accessory: MatterAccessory): WindowCoveringCluster | undefined;
843
+ //# sourceMappingURL=matterTypes.d.ts.map