homebridge 2.0.0-beta.41 → 2.0.0-beta.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/matter/MatterAPIImpl.d.ts.map +1 -1
- package/dist/matter/behaviors/AirQualityBehavior.d.ts +50 -0
- package/dist/matter/behaviors/AirQualityBehavior.d.ts.map +1 -0
- package/dist/matter/behaviors/AirQualityBehavior.js +55 -0
- package/dist/matter/behaviors/AirQualityBehavior.js.map +1 -0
- package/dist/matter/behaviors/AirQualityBehavior.spec.d.ts +5 -0
- package/dist/matter/behaviors/AirQualityBehavior.spec.d.ts.map +1 -0
- package/dist/matter/behaviors/AirQualityBehavior.spec.js +46 -0
- package/dist/matter/behaviors/AirQualityBehavior.spec.js.map +1 -0
- package/dist/matter/behaviors/ConcentrationMeasurementBehavior.d.ts +123 -0
- package/dist/matter/behaviors/ConcentrationMeasurementBehavior.d.ts.map +1 -0
- package/dist/matter/behaviors/ConcentrationMeasurementBehavior.js +147 -0
- package/dist/matter/behaviors/ConcentrationMeasurementBehavior.js.map +1 -0
- package/dist/matter/behaviors/ConcentrationMeasurementBehavior.spec.d.ts +5 -0
- package/dist/matter/behaviors/ConcentrationMeasurementBehavior.spec.d.ts.map +1 -0
- package/dist/matter/behaviors/ConcentrationMeasurementBehavior.spec.js +95 -0
- package/dist/matter/behaviors/ConcentrationMeasurementBehavior.spec.js.map +1 -0
- package/dist/matter/behaviors/index.d.ts +3 -1
- package/dist/matter/behaviors/index.d.ts.map +1 -1
- package/dist/matter/behaviors/index.js +2 -2
- package/dist/matter/behaviors/index.js.map +1 -1
- package/dist/matter/server.d.ts.map +1 -1
- package/dist/matter/server.js +12 -6
- package/dist/matter/server.js.map +1 -1
- package/dist/matter/serverHelpers.d.ts +9 -3
- package/dist/matter/serverHelpers.d.ts.map +1 -1
- package/dist/matter/serverHelpers.js +23 -11
- package/dist/matter/serverHelpers.js.map +1 -1
- package/dist/matter/serverHelpers.spec.js +13 -7
- package/dist/matter/serverHelpers.spec.js.map +1 -1
- package/dist/matter/types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MatterAPIImpl.d.ts","sourceRoot":"","sources":["../../src/matter/MatterAPIImpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAKzF,OAAO,EAAgB,QAAQ,EAAe,eAAe,EAA6B,MAAM,YAAY,CAAA;AA8B5G;;;;GAIG;AACH,qBAAa,aAAc,YAAW,SAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IA4CzB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAoB3B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAW3B;;OAEG;IACH,IAAI,IAAI,sDAEP;IAED;;OAEG;IACH,IAAI,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uFA+
|
|
1
|
+
{"version":3,"file":"MatterAPIImpl.d.ts","sourceRoot":"","sources":["../../src/matter/MatterAPIImpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,O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ACH,IAAI,KAAK,oBAER;IAED;;;;;OAKG;IACG,2BAA2B,CAC/B,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,eAAe,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC;IA8EhB;;;OAGG;IACG,yBAAyB,CAAC,WAAW,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAY9E;;;OAGG;IACG,6BAA6B,CACjC,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,eAAe,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC;IAmChB;;;OAGG;IACG,oBAAoB,CACxB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC;IA2BhB;;;;OAIG;IACG,iBAAiB,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAqChD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Air Quality Cluster Behavior
|
|
3
|
+
*
|
|
4
|
+
* Handles air quality sensor readings
|
|
5
|
+
* This cluster is primarily read-only, exposing air quality measurements to Matter controllers
|
|
6
|
+
*
|
|
7
|
+
* Example usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const accessory: MatterAccessory = {
|
|
10
|
+
* uuid: 'air-quality-sensor-1',
|
|
11
|
+
* displayName: 'Living Room Air Quality',
|
|
12
|
+
* deviceType: api.matter.deviceTypes.AirQualitySensor,
|
|
13
|
+
* serialNumber: 'AQ-12345',
|
|
14
|
+
* manufacturer: 'Acme',
|
|
15
|
+
* model: 'AQ-100',
|
|
16
|
+
* clusters: {
|
|
17
|
+
* airQuality: {
|
|
18
|
+
* airQuality: 1, // 0=Unknown, 1=Good, 2=Fair, 3=Moderate, 4=Poor, 5=VeryPoor, 6=ExtremelyPoor
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* // Update air quality reading
|
|
24
|
+
* await api.matter.updateClusterState(accessory.uuid, 'airQuality', { airQuality: 2 })
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import type { BehaviorRegistry } from './BehaviorRegistry.js';
|
|
28
|
+
import { AirQualityServer } from '@matter/main/behaviors/air-quality';
|
|
29
|
+
/**
|
|
30
|
+
* Custom Air Quality Server
|
|
31
|
+
*
|
|
32
|
+
* The Air Quality cluster provides an interface for monitoring air quality levels.
|
|
33
|
+
* It includes measurements for overall air quality and various pollutants.
|
|
34
|
+
*
|
|
35
|
+
* This is a read-only cluster - plugins update state via the Matter API,
|
|
36
|
+
* and Matter controllers read these values. No commands are defined.
|
|
37
|
+
*/
|
|
38
|
+
export declare class HomebridgeAirQualityServer extends AirQualityServer {
|
|
39
|
+
private static registry;
|
|
40
|
+
/**
|
|
41
|
+
* Set the behavior registry (called once during server initialization)
|
|
42
|
+
*/
|
|
43
|
+
static setRegistry(registry: BehaviorRegistry): void;
|
|
44
|
+
/**
|
|
45
|
+
* Initialize the air quality server
|
|
46
|
+
* Sets up any required state or listeners
|
|
47
|
+
*/
|
|
48
|
+
initialize(): void;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=AirQualityBehavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirQualityBehavior.d.ts","sourceRoot":"","sources":["../../../src/matter/behaviors/AirQualityBehavior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAErE;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,SAAQ,gBAAgB;IAC9D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IAEzC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAIpD;;;OAGG;IACM,UAAU,IAAI,IAAI;CAM5B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Air Quality Cluster Behavior
|
|
3
|
+
*
|
|
4
|
+
* Handles air quality sensor readings
|
|
5
|
+
* This cluster is primarily read-only, exposing air quality measurements to Matter controllers
|
|
6
|
+
*
|
|
7
|
+
* Example usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const accessory: MatterAccessory = {
|
|
10
|
+
* uuid: 'air-quality-sensor-1',
|
|
11
|
+
* displayName: 'Living Room Air Quality',
|
|
12
|
+
* deviceType: api.matter.deviceTypes.AirQualitySensor,
|
|
13
|
+
* serialNumber: 'AQ-12345',
|
|
14
|
+
* manufacturer: 'Acme',
|
|
15
|
+
* model: 'AQ-100',
|
|
16
|
+
* clusters: {
|
|
17
|
+
* airQuality: {
|
|
18
|
+
* airQuality: 1, // 0=Unknown, 1=Good, 2=Fair, 3=Moderate, 4=Poor, 5=VeryPoor, 6=ExtremelyPoor
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* // Update air quality reading
|
|
24
|
+
* await api.matter.updateClusterState(accessory.uuid, 'airQuality', { airQuality: 2 })
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import { AirQualityServer } from '@matter/main/behaviors/air-quality';
|
|
28
|
+
/**
|
|
29
|
+
* Custom Air Quality Server
|
|
30
|
+
*
|
|
31
|
+
* The Air Quality cluster provides an interface for monitoring air quality levels.
|
|
32
|
+
* It includes measurements for overall air quality and various pollutants.
|
|
33
|
+
*
|
|
34
|
+
* This is a read-only cluster - plugins update state via the Matter API,
|
|
35
|
+
* and Matter controllers read these values. No commands are defined.
|
|
36
|
+
*/
|
|
37
|
+
export class HomebridgeAirQualityServer extends AirQualityServer {
|
|
38
|
+
static registry;
|
|
39
|
+
/**
|
|
40
|
+
* Set the behavior registry (called once during server initialization)
|
|
41
|
+
*/
|
|
42
|
+
static setRegistry(registry) {
|
|
43
|
+
this.registry = registry;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Initialize the air quality server
|
|
47
|
+
* Sets up any required state or listeners
|
|
48
|
+
*/
|
|
49
|
+
initialize() {
|
|
50
|
+
super.initialize();
|
|
51
|
+
// Air Quality cluster is read-only, no command handlers needed
|
|
52
|
+
// State updates come from plugin via Matter API's updateClusterState()
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=AirQualityBehavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirQualityBehavior.js","sourceRoot":"","sources":["../../../src/matter/behaviors/AirQualityBehavior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAErE;;;;;;;;GAQG;AACH,MAAM,OAAO,0BAA2B,SAAQ,gBAAgB;IACtD,MAAM,CAAC,QAAQ,CAAkB;IAEzC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,QAA0B;QAC3C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED;;;OAGG;IACM,UAAU;QACjB,KAAK,CAAC,UAAU,EAAE,CAAA;QAElB,+DAA+D;QAC/D,uEAAuE;IACzE,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirQualityBehavior.spec.d.ts","sourceRoot":"","sources":["../../../src/matter/behaviors/AirQualityBehavior.spec.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for Air Quality Cluster Behavior
|
|
3
|
+
*/
|
|
4
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
+
import { HomebridgeAirQualityServer } from './AirQualityBehavior.js';
|
|
6
|
+
import { BehaviorRegistry } from './BehaviorRegistry.js';
|
|
7
|
+
describe('homebridgeAirQualityServer', () => {
|
|
8
|
+
let registry;
|
|
9
|
+
let accessoriesMap;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
accessoriesMap = new Map();
|
|
12
|
+
registry = new BehaviorRegistry(accessoriesMap);
|
|
13
|
+
HomebridgeAirQualityServer.setRegistry(registry);
|
|
14
|
+
});
|
|
15
|
+
describe('setRegistry', () => {
|
|
16
|
+
it('should set the registry', () => {
|
|
17
|
+
const newRegistry = new BehaviorRegistry(new Map());
|
|
18
|
+
HomebridgeAirQualityServer.setRegistry(newRegistry);
|
|
19
|
+
// eslint-disable-next-line dot-notation
|
|
20
|
+
expect(HomebridgeAirQualityServer['registry']).toBe(newRegistry);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe('initialize', () => {
|
|
24
|
+
it('should initialize without errors', () => {
|
|
25
|
+
// Mock super.initialize
|
|
26
|
+
const superInitialize = vi.spyOn(Object.getPrototypeOf(HomebridgeAirQualityServer.prototype), 'initialize');
|
|
27
|
+
superInitialize.mockImplementation(() => { });
|
|
28
|
+
// Air Quality behavior doesn't require special initialization
|
|
29
|
+
// It's a read-only cluster with no commands
|
|
30
|
+
expect(superInitialize).toBeDefined();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe('cluster characteristics', () => {
|
|
34
|
+
it('should be a read-only cluster with no commands', () => {
|
|
35
|
+
// Air Quality cluster has no commands, only read attributes
|
|
36
|
+
// This test verifies that the behavior doesn't implement any command handlers
|
|
37
|
+
// Unlike OnOff which has on/off/toggle commands
|
|
38
|
+
const prototype = HomebridgeAirQualityServer.prototype;
|
|
39
|
+
// Verify no command methods exist
|
|
40
|
+
expect(typeof prototype.on).toBe('undefined');
|
|
41
|
+
expect(typeof prototype.off).toBe('undefined');
|
|
42
|
+
expect(typeof prototype.toggle).toBe('undefined');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=AirQualityBehavior.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirQualityBehavior.spec.js","sourceRoot":"","sources":["../../../src/matter/behaviors/AirQualityBehavior.spec.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,IAAI,QAA0B,CAAA;IAC9B,IAAI,cAAgC,CAAA;IAEpC,UAAU,CAAC,GAAG,EAAE;QACd,cAAc,GAAG,IAAI,GAAG,EAAE,CAAA;QAC1B,QAAQ,GAAG,IAAI,gBAAgB,CAAC,cAAc,CAAC,CAAA;QAC/C,0BAA0B,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAClD,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QAC3B,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;YACjC,MAAM,WAAW,GAAG,IAAI,gBAAgB,CAAC,IAAI,GAAG,EAAE,CAAC,CAAA;YACnD,0BAA0B,CAAC,WAAW,CAAC,WAAW,CAAC,CAAA;YACnD,wCAAwC;YACxC,MAAM,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAClE,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QAC1B,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;YAC1C,wBAAwB;YACxB,MAAM,eAAe,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,CAAA;YAC3G,eAAe,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;YAE5C,8DAA8D;YAC9D,4CAA4C;YAC5C,MAAM,CAAC,eAAe,CAAC,CAAC,WAAW,EAAE,CAAA;QACvC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACvC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;YACxD,4DAA4D;YAC5D,8EAA8E;YAC9E,gDAAgD;YAChD,MAAM,SAAS,GAAG,0BAA0B,CAAC,SAAgB,CAAA;YAE7D,kCAAkC;YAClC,MAAM,CAAC,OAAO,SAAS,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;YAC7C,MAAM,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;YAC9C,MAAM,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QACnD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concentration Measurement Cluster Behavior
|
|
3
|
+
*
|
|
4
|
+
* Handles concentration measurement readings for various pollutants and gases.
|
|
5
|
+
* This cluster is primarily read-only, exposing concentration measurements to Matter controllers.
|
|
6
|
+
*
|
|
7
|
+
* Supported measurement types:
|
|
8
|
+
* - PM2.5: Fine particulate matter density
|
|
9
|
+
* - PM10: Coarse particulate matter density
|
|
10
|
+
* - Ozone (O3): Ozone concentration
|
|
11
|
+
* - NO2: Nitrogen dioxide concentration
|
|
12
|
+
* - CO: Carbon monoxide level
|
|
13
|
+
*
|
|
14
|
+
* Example usage:
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const accessory: MatterAccessory = {
|
|
17
|
+
* uuid: 'air-quality-sensor-1',
|
|
18
|
+
* displayName: 'Living Room Air Quality',
|
|
19
|
+
* deviceType: api.matter.deviceTypes.AirQualitySensor,
|
|
20
|
+
* serialNumber: 'AQ-12345',
|
|
21
|
+
* manufacturer: 'Acme',
|
|
22
|
+
* model: 'AQ-100',
|
|
23
|
+
* clusters: {
|
|
24
|
+
* pm25ConcentrationMeasurement: {
|
|
25
|
+
* measuredValue: 12.5, // PM2.5 concentration in µg/m³
|
|
26
|
+
* minMeasuredValue: 0,
|
|
27
|
+
* maxMeasuredValue: 1000,
|
|
28
|
+
* measurementUnit: 0, // 0 = µg/m³
|
|
29
|
+
* },
|
|
30
|
+
* pm10ConcentrationMeasurement: {
|
|
31
|
+
* measuredValue: 25.0, // PM10 concentration in µg/m³
|
|
32
|
+
* minMeasuredValue: 0,
|
|
33
|
+
* maxMeasuredValue: 1000,
|
|
34
|
+
* measurementUnit: 0,
|
|
35
|
+
* },
|
|
36
|
+
* ozoneConcentrationMeasurement: {
|
|
37
|
+
* measuredValue: 0.05, // Ozone concentration in ppm
|
|
38
|
+
* minMeasuredValue: 0,
|
|
39
|
+
* maxMeasuredValue: 1,
|
|
40
|
+
* measurementUnit: 1, // 1 = ppm
|
|
41
|
+
* },
|
|
42
|
+
* nitrogenDioxideConcentrationMeasurement: {
|
|
43
|
+
* measuredValue: 0.02, // NO2 concentration in ppm
|
|
44
|
+
* minMeasuredValue: 0,
|
|
45
|
+
* maxMeasuredValue: 1,
|
|
46
|
+
* measurementUnit: 1,
|
|
47
|
+
* },
|
|
48
|
+
* carbonMonoxideConcentrationMeasurement: {
|
|
49
|
+
* measuredValue: 3.0, // CO concentration in ppm
|
|
50
|
+
* minMeasuredValue: 0,
|
|
51
|
+
* maxMeasuredValue: 100,
|
|
52
|
+
* measurementUnit: 1,
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* // Update concentration readings
|
|
58
|
+
* await api.matter.updateClusterState(accessory.uuid, 'pm25ConcentrationMeasurement', { measuredValue: 15.3 })
|
|
59
|
+
* await api.matter.updateClusterState(accessory.uuid, 'carbonMonoxideConcentrationMeasurement', { measuredValue: 2.5 })
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
import type { BehaviorRegistry } from './BehaviorRegistry.js';
|
|
63
|
+
import { CarbonMonoxideConcentrationMeasurementServer } from '@matter/node/behaviors/carbon-monoxide-concentration-measurement';
|
|
64
|
+
import { NitrogenDioxideConcentrationMeasurementServer } from '@matter/node/behaviors/nitrogen-dioxide-concentration-measurement';
|
|
65
|
+
import { OzoneConcentrationMeasurementServer } from '@matter/node/behaviors/ozone-concentration-measurement';
|
|
66
|
+
import { Pm10ConcentrationMeasurementServer } from '@matter/node/behaviors/pm10-concentration-measurement';
|
|
67
|
+
import { Pm25ConcentrationMeasurementServer } from '@matter/node/behaviors/pm25-concentration-measurement';
|
|
68
|
+
/**
|
|
69
|
+
* Custom PM2.5 Concentration Measurement Server
|
|
70
|
+
*
|
|
71
|
+
* Measures fine particulate matter (particles with diameter ≤ 2.5 micrometers)
|
|
72
|
+
* This is a read-only cluster - plugins update state via the Matter API
|
|
73
|
+
*/
|
|
74
|
+
export declare class HomebridgePm25ConcentrationMeasurementServer extends Pm25ConcentrationMeasurementServer {
|
|
75
|
+
private static registry;
|
|
76
|
+
static setRegistry(registry: BehaviorRegistry): void;
|
|
77
|
+
initialize(): void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Custom PM10 Concentration Measurement Server
|
|
81
|
+
*
|
|
82
|
+
* Measures coarse particulate matter (particles with diameter ≤ 10 micrometers)
|
|
83
|
+
* This is a read-only cluster - plugins update state via the Matter API
|
|
84
|
+
*/
|
|
85
|
+
export declare class HomebridgePm10ConcentrationMeasurementServer extends Pm10ConcentrationMeasurementServer {
|
|
86
|
+
private static registry;
|
|
87
|
+
static setRegistry(registry: BehaviorRegistry): void;
|
|
88
|
+
initialize(): void;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Custom Ozone Concentration Measurement Server
|
|
92
|
+
*
|
|
93
|
+
* Measures ozone (O3) concentration
|
|
94
|
+
* This is a read-only cluster - plugins update state via the Matter API
|
|
95
|
+
*/
|
|
96
|
+
export declare class HomebridgeOzoneConcentrationMeasurementServer extends OzoneConcentrationMeasurementServer {
|
|
97
|
+
private static registry;
|
|
98
|
+
static setRegistry(registry: BehaviorRegistry): void;
|
|
99
|
+
initialize(): void;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Custom Nitrogen Dioxide Concentration Measurement Server
|
|
103
|
+
*
|
|
104
|
+
* Measures nitrogen dioxide (NO2) concentration
|
|
105
|
+
* This is a read-only cluster - plugins update state via the Matter API
|
|
106
|
+
*/
|
|
107
|
+
export declare class HomebridgeNitrogenDioxideConcentrationMeasurementServer extends NitrogenDioxideConcentrationMeasurementServer {
|
|
108
|
+
private static registry;
|
|
109
|
+
static setRegistry(registry: BehaviorRegistry): void;
|
|
110
|
+
initialize(): void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Custom Carbon Monoxide Concentration Measurement Server
|
|
114
|
+
*
|
|
115
|
+
* Measures carbon monoxide (CO) concentration
|
|
116
|
+
* This is a read-only cluster - plugins update state via the Matter API
|
|
117
|
+
*/
|
|
118
|
+
export declare class HomebridgeCarbonMonoxideConcentrationMeasurementServer extends CarbonMonoxideConcentrationMeasurementServer {
|
|
119
|
+
private static registry;
|
|
120
|
+
static setRegistry(registry: BehaviorRegistry): void;
|
|
121
|
+
initialize(): void;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=ConcentrationMeasurementBehavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConcentrationMeasurementBehavior.d.ts","sourceRoot":"","sources":["../../../src/matter/behaviors/ConcentrationMeasurementBehavior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,4CAA4C,EAAE,MAAM,kEAAkE,CAAA;AAC/H,OAAO,EAAE,6CAA6C,EAAE,MAAM,mEAAmE,CAAA;AACjI,OAAO,EAAE,mCAAmC,EAAE,MAAM,wDAAwD,CAAA;AAC5G,OAAO,EAAE,kCAAkC,EAAE,MAAM,uDAAuD,CAAA;AAC1G,OAAO,EAAE,kCAAkC,EAAE,MAAM,uDAAuD,CAAA;AAE1G;;;;;GAKG;AACH,qBAAa,4CAA6C,SAAQ,kCAAkC;IAClG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IAEzC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAI3C,UAAU,IAAI,IAAI;CAI5B;AAED;;;;;GAKG;AACH,qBAAa,4CAA6C,SAAQ,kCAAkC;IAClG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IAEzC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAI3C,UAAU,IAAI,IAAI;CAI5B;AAED;;;;;GAKG;AACH,qBAAa,6CAA8C,SAAQ,mCAAmC;IACpG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IAEzC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAI3C,UAAU,IAAI,IAAI;CAI5B;AAED;;;;;GAKG;AACH,qBAAa,uDAAwD,SAAQ,6CAA6C;IACxH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IAEzC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAI3C,UAAU,IAAI,IAAI;CAI5B;AAED;;;;;GAKG;AACH,qBAAa,sDAAuD,SAAQ,4CAA4C;IACtH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IAEzC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAI3C,UAAU,IAAI,IAAI;CAI5B"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concentration Measurement Cluster Behavior
|
|
3
|
+
*
|
|
4
|
+
* Handles concentration measurement readings for various pollutants and gases.
|
|
5
|
+
* This cluster is primarily read-only, exposing concentration measurements to Matter controllers.
|
|
6
|
+
*
|
|
7
|
+
* Supported measurement types:
|
|
8
|
+
* - PM2.5: Fine particulate matter density
|
|
9
|
+
* - PM10: Coarse particulate matter density
|
|
10
|
+
* - Ozone (O3): Ozone concentration
|
|
11
|
+
* - NO2: Nitrogen dioxide concentration
|
|
12
|
+
* - CO: Carbon monoxide level
|
|
13
|
+
*
|
|
14
|
+
* Example usage:
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const accessory: MatterAccessory = {
|
|
17
|
+
* uuid: 'air-quality-sensor-1',
|
|
18
|
+
* displayName: 'Living Room Air Quality',
|
|
19
|
+
* deviceType: api.matter.deviceTypes.AirQualitySensor,
|
|
20
|
+
* serialNumber: 'AQ-12345',
|
|
21
|
+
* manufacturer: 'Acme',
|
|
22
|
+
* model: 'AQ-100',
|
|
23
|
+
* clusters: {
|
|
24
|
+
* pm25ConcentrationMeasurement: {
|
|
25
|
+
* measuredValue: 12.5, // PM2.5 concentration in µg/m³
|
|
26
|
+
* minMeasuredValue: 0,
|
|
27
|
+
* maxMeasuredValue: 1000,
|
|
28
|
+
* measurementUnit: 0, // 0 = µg/m³
|
|
29
|
+
* },
|
|
30
|
+
* pm10ConcentrationMeasurement: {
|
|
31
|
+
* measuredValue: 25.0, // PM10 concentration in µg/m³
|
|
32
|
+
* minMeasuredValue: 0,
|
|
33
|
+
* maxMeasuredValue: 1000,
|
|
34
|
+
* measurementUnit: 0,
|
|
35
|
+
* },
|
|
36
|
+
* ozoneConcentrationMeasurement: {
|
|
37
|
+
* measuredValue: 0.05, // Ozone concentration in ppm
|
|
38
|
+
* minMeasuredValue: 0,
|
|
39
|
+
* maxMeasuredValue: 1,
|
|
40
|
+
* measurementUnit: 1, // 1 = ppm
|
|
41
|
+
* },
|
|
42
|
+
* nitrogenDioxideConcentrationMeasurement: {
|
|
43
|
+
* measuredValue: 0.02, // NO2 concentration in ppm
|
|
44
|
+
* minMeasuredValue: 0,
|
|
45
|
+
* maxMeasuredValue: 1,
|
|
46
|
+
* measurementUnit: 1,
|
|
47
|
+
* },
|
|
48
|
+
* carbonMonoxideConcentrationMeasurement: {
|
|
49
|
+
* measuredValue: 3.0, // CO concentration in ppm
|
|
50
|
+
* minMeasuredValue: 0,
|
|
51
|
+
* maxMeasuredValue: 100,
|
|
52
|
+
* measurementUnit: 1,
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* // Update concentration readings
|
|
58
|
+
* await api.matter.updateClusterState(accessory.uuid, 'pm25ConcentrationMeasurement', { measuredValue: 15.3 })
|
|
59
|
+
* await api.matter.updateClusterState(accessory.uuid, 'carbonMonoxideConcentrationMeasurement', { measuredValue: 2.5 })
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
import { CarbonMonoxideConcentrationMeasurementServer } from '@matter/node/behaviors/carbon-monoxide-concentration-measurement';
|
|
63
|
+
import { NitrogenDioxideConcentrationMeasurementServer } from '@matter/node/behaviors/nitrogen-dioxide-concentration-measurement';
|
|
64
|
+
import { OzoneConcentrationMeasurementServer } from '@matter/node/behaviors/ozone-concentration-measurement';
|
|
65
|
+
import { Pm10ConcentrationMeasurementServer } from '@matter/node/behaviors/pm10-concentration-measurement';
|
|
66
|
+
import { Pm25ConcentrationMeasurementServer } from '@matter/node/behaviors/pm25-concentration-measurement';
|
|
67
|
+
/**
|
|
68
|
+
* Custom PM2.5 Concentration Measurement Server
|
|
69
|
+
*
|
|
70
|
+
* Measures fine particulate matter (particles with diameter ≤ 2.5 micrometers)
|
|
71
|
+
* This is a read-only cluster - plugins update state via the Matter API
|
|
72
|
+
*/
|
|
73
|
+
export class HomebridgePm25ConcentrationMeasurementServer extends Pm25ConcentrationMeasurementServer {
|
|
74
|
+
static registry;
|
|
75
|
+
static setRegistry(registry) {
|
|
76
|
+
this.registry = registry;
|
|
77
|
+
}
|
|
78
|
+
initialize() {
|
|
79
|
+
super.initialize();
|
|
80
|
+
// Read-only cluster, no command handlers needed
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Custom PM10 Concentration Measurement Server
|
|
85
|
+
*
|
|
86
|
+
* Measures coarse particulate matter (particles with diameter ≤ 10 micrometers)
|
|
87
|
+
* This is a read-only cluster - plugins update state via the Matter API
|
|
88
|
+
*/
|
|
89
|
+
export class HomebridgePm10ConcentrationMeasurementServer extends Pm10ConcentrationMeasurementServer {
|
|
90
|
+
static registry;
|
|
91
|
+
static setRegistry(registry) {
|
|
92
|
+
this.registry = registry;
|
|
93
|
+
}
|
|
94
|
+
initialize() {
|
|
95
|
+
super.initialize();
|
|
96
|
+
// Read-only cluster, no command handlers needed
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Custom Ozone Concentration Measurement Server
|
|
101
|
+
*
|
|
102
|
+
* Measures ozone (O3) concentration
|
|
103
|
+
* This is a read-only cluster - plugins update state via the Matter API
|
|
104
|
+
*/
|
|
105
|
+
export class HomebridgeOzoneConcentrationMeasurementServer extends OzoneConcentrationMeasurementServer {
|
|
106
|
+
static registry;
|
|
107
|
+
static setRegistry(registry) {
|
|
108
|
+
this.registry = registry;
|
|
109
|
+
}
|
|
110
|
+
initialize() {
|
|
111
|
+
super.initialize();
|
|
112
|
+
// Read-only cluster, no command handlers needed
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Custom Nitrogen Dioxide Concentration Measurement Server
|
|
117
|
+
*
|
|
118
|
+
* Measures nitrogen dioxide (NO2) concentration
|
|
119
|
+
* This is a read-only cluster - plugins update state via the Matter API
|
|
120
|
+
*/
|
|
121
|
+
export class HomebridgeNitrogenDioxideConcentrationMeasurementServer extends NitrogenDioxideConcentrationMeasurementServer {
|
|
122
|
+
static registry;
|
|
123
|
+
static setRegistry(registry) {
|
|
124
|
+
this.registry = registry;
|
|
125
|
+
}
|
|
126
|
+
initialize() {
|
|
127
|
+
super.initialize();
|
|
128
|
+
// Read-only cluster, no command handlers needed
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Custom Carbon Monoxide Concentration Measurement Server
|
|
133
|
+
*
|
|
134
|
+
* Measures carbon monoxide (CO) concentration
|
|
135
|
+
* This is a read-only cluster - plugins update state via the Matter API
|
|
136
|
+
*/
|
|
137
|
+
export class HomebridgeCarbonMonoxideConcentrationMeasurementServer extends CarbonMonoxideConcentrationMeasurementServer {
|
|
138
|
+
static registry;
|
|
139
|
+
static setRegistry(registry) {
|
|
140
|
+
this.registry = registry;
|
|
141
|
+
}
|
|
142
|
+
initialize() {
|
|
143
|
+
super.initialize();
|
|
144
|
+
// Read-only cluster, no command handlers needed
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=ConcentrationMeasurementBehavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConcentrationMeasurementBehavior.js","sourceRoot":"","sources":["../../../src/matter/behaviors/ConcentrationMeasurementBehavior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C3C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAEQ,UAAU;QACjB,KAAK,CAAC,UAAU,EAAE,CAAA;QAClB,gDAAgD;IAClD,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,sDAAuD,SAAQ,4CAA4C;IAC9G,MAAM,CAAC,QAAQ,CAAkB;IAEzC,MAAM,CAAC,WAAW,CAAC,QAA0B;QAC3C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAEQ,UAAU;QACjB,KAAK,CAAC,UAAU,EAAE,CAAA;QAClB,gDAAgD;IAClD,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConcentrationMeasurementBehavior.spec.d.ts","sourceRoot":"","sources":["../../../src/matter/behaviors/ConcentrationMeasurementBehavior.spec.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for Concentration Measurement Cluster Behaviors
|
|
3
|
+
*/
|
|
4
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
5
|
+
import { BehaviorRegistry } from './BehaviorRegistry.js';
|
|
6
|
+
import { HomebridgeCarbonMonoxideConcentrationMeasurementServer, HomebridgeNitrogenDioxideConcentrationMeasurementServer, HomebridgeOzoneConcentrationMeasurementServer, HomebridgePm10ConcentrationMeasurementServer, HomebridgePm25ConcentrationMeasurementServer, } from './ConcentrationMeasurementBehavior.js';
|
|
7
|
+
describe('concentration measurement behaviors', () => {
|
|
8
|
+
let registry;
|
|
9
|
+
let accessoriesMap;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
accessoriesMap = new Map();
|
|
12
|
+
registry = new BehaviorRegistry(accessoriesMap);
|
|
13
|
+
});
|
|
14
|
+
describe('homebridgePm25ConcentrationMeasurementServer', () => {
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
HomebridgePm25ConcentrationMeasurementServer.setRegistry(registry);
|
|
17
|
+
});
|
|
18
|
+
it('should set the registry', () => {
|
|
19
|
+
const newRegistry = new BehaviorRegistry(new Map());
|
|
20
|
+
HomebridgePm25ConcentrationMeasurementServer.setRegistry(newRegistry);
|
|
21
|
+
// eslint-disable-next-line dot-notation
|
|
22
|
+
expect(HomebridgePm25ConcentrationMeasurementServer['registry']).toBe(newRegistry);
|
|
23
|
+
});
|
|
24
|
+
it('should be a read-only cluster with no commands', () => {
|
|
25
|
+
const prototype = HomebridgePm25ConcentrationMeasurementServer.prototype;
|
|
26
|
+
expect(typeof prototype.on).toBe('undefined');
|
|
27
|
+
expect(typeof prototype.off).toBe('undefined');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
describe('homebridgePm10ConcentrationMeasurementServer', () => {
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
HomebridgePm10ConcentrationMeasurementServer.setRegistry(registry);
|
|
33
|
+
});
|
|
34
|
+
it('should set the registry', () => {
|
|
35
|
+
const newRegistry = new BehaviorRegistry(new Map());
|
|
36
|
+
HomebridgePm10ConcentrationMeasurementServer.setRegistry(newRegistry);
|
|
37
|
+
// eslint-disable-next-line dot-notation
|
|
38
|
+
expect(HomebridgePm10ConcentrationMeasurementServer['registry']).toBe(newRegistry);
|
|
39
|
+
});
|
|
40
|
+
it('should be a read-only cluster with no commands', () => {
|
|
41
|
+
const prototype = HomebridgePm10ConcentrationMeasurementServer.prototype;
|
|
42
|
+
expect(typeof prototype.on).toBe('undefined');
|
|
43
|
+
expect(typeof prototype.off).toBe('undefined');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe('homebridgeOzoneConcentrationMeasurementServer', () => {
|
|
47
|
+
beforeEach(() => {
|
|
48
|
+
HomebridgeOzoneConcentrationMeasurementServer.setRegistry(registry);
|
|
49
|
+
});
|
|
50
|
+
it('should set the registry', () => {
|
|
51
|
+
const newRegistry = new BehaviorRegistry(new Map());
|
|
52
|
+
HomebridgeOzoneConcentrationMeasurementServer.setRegistry(newRegistry);
|
|
53
|
+
// eslint-disable-next-line dot-notation
|
|
54
|
+
expect(HomebridgeOzoneConcentrationMeasurementServer['registry']).toBe(newRegistry);
|
|
55
|
+
});
|
|
56
|
+
it('should be a read-only cluster with no commands', () => {
|
|
57
|
+
const prototype = HomebridgeOzoneConcentrationMeasurementServer.prototype;
|
|
58
|
+
expect(typeof prototype.on).toBe('undefined');
|
|
59
|
+
expect(typeof prototype.off).toBe('undefined');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
describe('homebridgeNitrogenDioxideConcentrationMeasurementServer', () => {
|
|
63
|
+
beforeEach(() => {
|
|
64
|
+
HomebridgeNitrogenDioxideConcentrationMeasurementServer.setRegistry(registry);
|
|
65
|
+
});
|
|
66
|
+
it('should set the registry', () => {
|
|
67
|
+
const newRegistry = new BehaviorRegistry(new Map());
|
|
68
|
+
HomebridgeNitrogenDioxideConcentrationMeasurementServer.setRegistry(newRegistry);
|
|
69
|
+
// eslint-disable-next-line dot-notation
|
|
70
|
+
expect(HomebridgeNitrogenDioxideConcentrationMeasurementServer['registry']).toBe(newRegistry);
|
|
71
|
+
});
|
|
72
|
+
it('should be a read-only cluster with no commands', () => {
|
|
73
|
+
const prototype = HomebridgeNitrogenDioxideConcentrationMeasurementServer.prototype;
|
|
74
|
+
expect(typeof prototype.on).toBe('undefined');
|
|
75
|
+
expect(typeof prototype.off).toBe('undefined');
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe('homebridgeCarbonMonoxideConcentrationMeasurementServer', () => {
|
|
79
|
+
beforeEach(() => {
|
|
80
|
+
HomebridgeCarbonMonoxideConcentrationMeasurementServer.setRegistry(registry);
|
|
81
|
+
});
|
|
82
|
+
it('should set the registry', () => {
|
|
83
|
+
const newRegistry = new BehaviorRegistry(new Map());
|
|
84
|
+
HomebridgeCarbonMonoxideConcentrationMeasurementServer.setRegistry(newRegistry);
|
|
85
|
+
// eslint-disable-next-line dot-notation
|
|
86
|
+
expect(HomebridgeCarbonMonoxideConcentrationMeasurementServer['registry']).toBe(newRegistry);
|
|
87
|
+
});
|
|
88
|
+
it('should be a read-only cluster with no commands', () => {
|
|
89
|
+
const prototype = HomebridgeCarbonMonoxideConcentrationMeasurementServer.prototype;
|
|
90
|
+
expect(typeof prototype.on).toBe('undefined');
|
|
91
|
+
expect(typeof prototype.off).toBe('undefined');
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=ConcentrationMeasurementBehavior.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConcentrationMeasurementBehavior.spec.js","sourceRoot":"","sources":["../../../src/matter/behaviors/ConcentrationMeasurementBehavior.spec.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EACL,sDAAsD,EACtD,uDAAuD,EACvD,6CAA6C,EAC7C,4CAA4C,EAC5C,4CAA4C,GAC7C,MAAM,uCAAuC,CAAA;AAE9C,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACnD,IAAI,QAA0B,CAAA;IAC9B,IAAI,cAAgC,CAAA;IAEpC,UAAU,CAAC,GAAG,EAAE;QACd,cAAc,GAAG,IAAI,GAAG,EAAE,CAAA;QAC1B,QAAQ,GAAG,IAAI,gBAAgB,CAAC,cAAc,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,8CAA8C,EAAE,GAAG,EAAE;QAC5D,UAAU,CAAC,GAAG,EAAE;YACd,4CAA4C,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QACpE,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;YACjC,MAAM,WAAW,GAAG,IAAI,gB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|
6
|
-
export {
|
|
6
|
+
export { HomebridgeAirQualityServer } from './AirQualityBehavior.js';
|
|
7
7
|
export type { MatterAccessoryMap, MatterCommandHandler } from './BehaviorRegistry.js';
|
|
8
|
+
export { BehaviorRegistry } from './BehaviorRegistry.js';
|
|
8
9
|
export { HomebridgeColorControlServer } from './ColorControlBehavior.js';
|
|
10
|
+
export { HomebridgeCarbonMonoxideConcentrationMeasurementServer, HomebridgeNitrogenDioxideConcentrationMeasurementServer, HomebridgeOzoneConcentrationMeasurementServer, HomebridgePm10ConcentrationMeasurementServer, HomebridgePm25ConcentrationMeasurementServer, } from './ConcentrationMeasurementBehavior.js';
|
|
9
11
|
export { HomebridgeDoorLockServer } from './DoorLockBehavior.js';
|
|
10
12
|
export { HomebridgeFanControlServer } from './FanControlBehavior.js';
|
|
11
13
|
export { HomebridgeIdentifyServer } from './IdentifyBehavior.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/matter/behaviors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/matter/behaviors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,EACL,sDAAsD,EACtD,uDAAuD,EACvD,6CAA6C,EAC7C,4CAA4C,EAC5C,4CAA4C,GAC7C,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAA;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAA"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Exports all behavior classes and the registry
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
export { HomebridgeAirQualityServer } from './AirQualityBehavior.js';
|
|
7
7
|
export { BehaviorRegistry } from './BehaviorRegistry.js';
|
|
8
|
-
// Export all behaviors from individual files (alphabetically)
|
|
9
8
|
export { HomebridgeColorControlServer } from './ColorControlBehavior.js';
|
|
9
|
+
export { HomebridgeCarbonMonoxideConcentrationMeasurementServer, HomebridgeNitrogenDioxideConcentrationMeasurementServer, HomebridgeOzoneConcentrationMeasurementServer, HomebridgePm10ConcentrationMeasurementServer, HomebridgePm25ConcentrationMeasurementServer, } from './ConcentrationMeasurementBehavior.js';
|
|
10
10
|
export { HomebridgeDoorLockServer } from './DoorLockBehavior.js';
|
|
11
11
|
export { HomebridgeFanControlServer } from './FanControlBehavior.js';
|
|
12
12
|
export { HomebridgeIdentifyServer } from './IdentifyBehavior.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/matter/behaviors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/matter/behaviors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,EACL,sDAAsD,EACtD,uDAAuD,EACvD,6CAA6C,EAC7C,4CAA4C,EAC5C,4CAA4C,GAC7C,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAA;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAA"}
|