matterbridge 1.6.6-dev.1 → 1.6.6-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/matterbridgeEndpoint.js +36 -35
- package/npm-shrinkwrap.json +5 -8
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
41
41
|
deviceType;
|
|
42
42
|
uniqueStorageKey = undefined;
|
|
43
43
|
tagList = undefined;
|
|
44
|
+
subType = '';
|
|
44
45
|
deviceTypes = new Map();
|
|
45
46
|
clusterServers = new Map();
|
|
46
47
|
clusterClients = new Map();
|
|
@@ -115,7 +116,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
115
116
|
});
|
|
116
117
|
return behaviorTypes;
|
|
117
118
|
}
|
|
118
|
-
static getBehaviourTypeFromClusterServerId(clusterId,
|
|
119
|
+
static getBehaviourTypeFromClusterServerId(clusterId, subType) {
|
|
119
120
|
if (clusterId === Identify.Cluster.id)
|
|
120
121
|
return MatterbridgeIdentifyServer;
|
|
121
122
|
if (clusterId === Groups.Cluster.id)
|
|
@@ -124,29 +125,35 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
124
125
|
return MatterbridgeOnOffServer.with('Lighting');
|
|
125
126
|
if (clusterId === LevelControl.Cluster.id)
|
|
126
127
|
return MatterbridgeLevelControlServer;
|
|
127
|
-
if (clusterId === ColorControl.Cluster.id &&
|
|
128
|
+
if (clusterId === ColorControl.Cluster.id && subType === undefined)
|
|
128
129
|
return MatterbridgeColorControlServer;
|
|
129
|
-
if (clusterId === ColorControl.Cluster.id &&
|
|
130
|
+
if (clusterId === ColorControl.Cluster.id && subType === 'CompleteColorControl')
|
|
131
|
+
return MatterbridgeColorControlServer;
|
|
132
|
+
if (clusterId === ColorControl.Cluster.id && subType === 'XyColorControl')
|
|
130
133
|
return MatterbridgeColorControlServer.with('Xy');
|
|
131
|
-
if (clusterId === ColorControl.Cluster.id &&
|
|
134
|
+
if (clusterId === ColorControl.Cluster.id && subType === 'HueSaturationColorControl')
|
|
132
135
|
return MatterbridgeColorControlServer.with('HueSaturation');
|
|
133
|
-
if (clusterId === ColorControl.Cluster.id &&
|
|
136
|
+
if (clusterId === ColorControl.Cluster.id && subType === 'ColorTemperatureColorControl')
|
|
134
137
|
return MatterbridgeColorControlServer.with('ColorTemperature');
|
|
135
138
|
if (clusterId === DoorLock.Cluster.id)
|
|
136
139
|
return MatterbridgeDoorLockServer;
|
|
137
|
-
if (clusterId === Thermostat.Cluster.id &&
|
|
140
|
+
if (clusterId === Thermostat.Cluster.id && subType === undefined)
|
|
141
|
+
return MatterbridgeThermostatServer.with('AutoMode', 'Heating', 'Cooling');
|
|
142
|
+
if (clusterId === Thermostat.Cluster.id && subType === 'AutoModeThermostat')
|
|
138
143
|
return MatterbridgeThermostatServer.with('AutoMode', 'Heating', 'Cooling');
|
|
139
|
-
if (clusterId === Thermostat.Cluster.id &&
|
|
144
|
+
if (clusterId === Thermostat.Cluster.id && subType === 'HeatingThermostat')
|
|
140
145
|
return MatterbridgeThermostatServer.with('Heating');
|
|
141
|
-
if (clusterId === Thermostat.Cluster.id &&
|
|
146
|
+
if (clusterId === Thermostat.Cluster.id && subType === 'CoolingThermostat')
|
|
142
147
|
return MatterbridgeThermostatServer.with('Cooling');
|
|
143
148
|
if (clusterId === WindowCovering.Cluster.id)
|
|
144
149
|
return MatterbridgeWindowCoveringServer;
|
|
145
150
|
if (clusterId === FanControl.Cluster.id)
|
|
146
151
|
return MatterbridgeFanControlServer;
|
|
147
|
-
if (clusterId === Switch.Cluster.id &&
|
|
152
|
+
if (clusterId === Switch.Cluster.id && subType === undefined)
|
|
148
153
|
return SwitchServer.with('MomentarySwitch', 'MomentarySwitchRelease', 'MomentarySwitchLongPress', 'MomentarySwitchMultiPress');
|
|
149
|
-
if (clusterId === Switch.Cluster.id &&
|
|
154
|
+
if (clusterId === Switch.Cluster.id && subType === 'MomentarySwitch')
|
|
155
|
+
return SwitchServer.with('MomentarySwitch', 'MomentarySwitchRelease', 'MomentarySwitchLongPress', 'MomentarySwitchMultiPress');
|
|
156
|
+
if (clusterId === Switch.Cluster.id && subType === 'LatchingSwitch')
|
|
150
157
|
return SwitchServer.with('LatchingSwitch');
|
|
151
158
|
if (clusterId === TemperatureMeasurement.Cluster.id)
|
|
152
159
|
return TemperatureMeasurementServer;
|
|
@@ -200,11 +207,13 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
200
207
|
return ElectricalPowerMeasurementServer.with('AlternatingCurrent');
|
|
201
208
|
if (clusterId === ElectricalEnergyMeasurement.Cluster.id)
|
|
202
209
|
return ElectricalEnergyMeasurementServer.with('ImportedEnergy', 'ExportedEnergy', 'CumulativeEnergy');
|
|
203
|
-
if (clusterId === PowerSource.Cluster.id &&
|
|
210
|
+
if (clusterId === PowerSource.Cluster.id && subType === undefined)
|
|
211
|
+
return PowerSourceServer;
|
|
212
|
+
if (clusterId === PowerSource.Cluster.id && subType === 'WiredPowerSource')
|
|
204
213
|
return PowerSourceServer.with(PowerSource.Feature.Wired);
|
|
205
|
-
if (clusterId === PowerSource.Cluster.id &&
|
|
214
|
+
if (clusterId === PowerSource.Cluster.id && subType === 'BatteryReplaceablePowerSource')
|
|
206
215
|
return PowerSourceServer.with(PowerSource.Feature.Battery, PowerSource.Feature.Replaceable);
|
|
207
|
-
if (clusterId === PowerSource.Cluster.id &&
|
|
216
|
+
if (clusterId === PowerSource.Cluster.id && subType === 'BatteryRechargeablePowerSource')
|
|
208
217
|
return PowerSourceServer.with(PowerSource.Feature.Battery, PowerSource.Feature.Rechargeable);
|
|
209
218
|
if (clusterId === BasicInformation.Cluster.id)
|
|
210
219
|
return BasicInformationServer;
|
|
@@ -410,40 +419,32 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
410
419
|
if (this.clusterServers.has(cluster.id)) {
|
|
411
420
|
this.log.debug(`****cluster ${hk}${'0x' + cluster.id.toString(16).padStart(4, '0')}${db}-${hk}${getClusterNameById(cluster.id)}${db} already added`);
|
|
412
421
|
}
|
|
413
|
-
|
|
422
|
+
this.subType = '';
|
|
414
423
|
if (cluster.id === ColorControl.Cluster.id && cluster.isAttributeSupportedByName('currentX') && !cluster.isAttributeSupportedByName('currentHue') && !cluster.isAttributeSupportedByName('colorTemperatureMireds'))
|
|
415
|
-
|
|
424
|
+
this.subType = 'XyColorControl';
|
|
416
425
|
else if (cluster.id === ColorControl.Cluster.id && cluster.isAttributeSupportedByName('currentHue') && !cluster.isAttributeSupportedByName('currentX') && !cluster.isAttributeSupportedByName('colorTemperatureMireds'))
|
|
417
|
-
|
|
426
|
+
this.subType = 'HueSaturationColorControl';
|
|
418
427
|
else if (cluster.id === ColorControl.Cluster.id && cluster.isAttributeSupportedByName('colorTemperatureMireds') && !cluster.isAttributeSupportedByName('currentHue') && !cluster.isAttributeSupportedByName('currentX'))
|
|
419
|
-
|
|
428
|
+
this.subType = 'ColorTemperatureColorControl';
|
|
420
429
|
else
|
|
421
|
-
|
|
430
|
+
this.subType = 'CompleteColorControl';
|
|
422
431
|
if (cluster.id === SwitchCluster.id && cluster.isEventSupportedByName('multiPressComplete'))
|
|
423
|
-
|
|
432
|
+
this.subType = 'MomentarySwitch';
|
|
424
433
|
if (cluster.id === SwitchCluster.id && cluster.isEventSupportedByName('switchLatched'))
|
|
425
|
-
|
|
434
|
+
this.subType = 'LatchingSwitch';
|
|
426
435
|
if (cluster.id === PowerSourceCluster.id && cluster.isAttributeSupportedByName('wiredCurrentType'))
|
|
427
|
-
|
|
436
|
+
this.subType = 'WiredPowerSource';
|
|
428
437
|
if (cluster.id === PowerSourceCluster.id && cluster.isAttributeSupportedByName('batReplacementDescription'))
|
|
429
|
-
|
|
438
|
+
this.subType = 'BatteryReplaceablePowerSource';
|
|
430
439
|
if (cluster.id === PowerSourceCluster.id && cluster.isAttributeSupportedByName('batChargeState'))
|
|
431
|
-
|
|
440
|
+
this.subType = 'BatteryRechargeablePowerSource';
|
|
432
441
|
if (cluster.id === ThermostatCluster.id && cluster.isAttributeSupportedByName('occupiedCoolingSetpoint'))
|
|
433
|
-
|
|
442
|
+
this.subType = 'CoolingThermostat';
|
|
434
443
|
if (cluster.id === ThermostatCluster.id && cluster.isAttributeSupportedByName('occupiedHeatingSetpoint'))
|
|
435
|
-
|
|
444
|
+
this.subType = 'HeatingThermostat';
|
|
436
445
|
if (cluster.id === ThermostatCluster.id && cluster.isAttributeSupportedByName('minSetpointDeadBand'))
|
|
437
|
-
|
|
438
|
-
const behavior = MatterbridgeEndpoint.getBehaviourTypeFromClusterServerId(cluster.id,
|
|
439
|
-
if (cluster.id === PowerTopologyCluster.id && this.clusterServers.has(cluster.id))
|
|
440
|
-
return;
|
|
441
|
-
if (cluster.id === ElectricalPowerMeasurementCluster.id && this.clusterServers.has(cluster.id))
|
|
442
|
-
return;
|
|
443
|
-
if (cluster.id === ElectricalEnergyMeasurementCluster.id && this.clusterServers.has(cluster.id))
|
|
444
|
-
return;
|
|
445
|
-
if (cluster.id === ThermostatCluster.id && this.clusterServers.has(cluster.id))
|
|
446
|
-
return;
|
|
446
|
+
this.subType = 'AutoModeThermostat';
|
|
447
|
+
const behavior = MatterbridgeEndpoint.getBehaviourTypeFromClusterServerId(cluster.id, this.subType);
|
|
447
448
|
this.clusterServers.set(cluster.id, cluster);
|
|
448
449
|
if (cluster.id === BasicInformationCluster.id)
|
|
449
450
|
return;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "1.6.6-dev.
|
|
3
|
+
"version": "1.6.6-dev.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge",
|
|
9
|
-
"version": "1.6.6-dev.
|
|
9
|
+
"version": "1.6.6-dev.2",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@matter/main": "0.11.8",
|
|
@@ -945,13 +945,10 @@
|
|
|
945
945
|
}
|
|
946
946
|
},
|
|
947
947
|
"node_modules/gopd": {
|
|
948
|
-
"version": "1.
|
|
949
|
-
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.
|
|
950
|
-
"integrity": "sha512-
|
|
948
|
+
"version": "1.2.0",
|
|
949
|
+
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
|
950
|
+
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
|
951
951
|
"license": "MIT",
|
|
952
|
-
"dependencies": {
|
|
953
|
-
"get-intrinsic": "^1.2.4"
|
|
954
|
-
},
|
|
955
952
|
"engines": {
|
|
956
953
|
"node": ">= 0.4"
|
|
957
954
|
},
|