matterbridge-example-dynamic-platform 1.2.4-dev-20250612-b04ef65 → 1.2.4-dev-20250613-639b0ce
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 +5 -0
- package/dist/platform.js +6 -12
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -10,11 +10,16 @@ If you like this project and find it useful, please consider giving it a star on
|
|
10
10
|
|
11
11
|
## [1.2.4] - 2025-06-11
|
12
12
|
|
13
|
+
### Added
|
14
|
+
|
15
|
+
- [npm]: The dev of matterbridge-example-dynamic-platform is published with tag **dev** on **npm** each day at 00:00 UTC if there is a new commit.
|
16
|
+
|
13
17
|
### Changed
|
14
18
|
|
15
19
|
- [package]: Require matterbridge 3.0.6.
|
16
20
|
- [package]: Updated package.
|
17
21
|
- [package]: Updated dependencies.
|
22
|
+
- [subscribe]: Prevent attribute setting when context is offline for air purifier and fan.
|
18
23
|
|
19
24
|
<a href="https://www.buymeacoffee.com/luligugithub">
|
20
25
|
<img src="bmc-button.svg" alt="Buy me a coffee" width="80">
|
package/dist/platform.js
CHANGED
@@ -676,18 +676,23 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
676
676
|
if (context.offline === true)
|
677
677
|
return;
|
678
678
|
if (newValue === FanControl.FanMode.Off) {
|
679
|
+
this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentSettings', 0, this.airPurifier?.log);
|
679
680
|
this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentCurrent', 0, this.airPurifier?.log);
|
680
681
|
}
|
681
682
|
else if (newValue === FanControl.FanMode.Low) {
|
683
|
+
this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentSettings', 33, this.airPurifier?.log);
|
682
684
|
this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentCurrent', 33, this.airPurifier?.log);
|
683
685
|
}
|
684
686
|
else if (newValue === FanControl.FanMode.Medium) {
|
687
|
+
this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentSettings', 66, this.airPurifier?.log);
|
685
688
|
this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentCurrent', 66, this.airPurifier?.log);
|
686
689
|
}
|
687
690
|
else if (newValue === FanControl.FanMode.High) {
|
691
|
+
this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentSettings', 100, this.airPurifier?.log);
|
688
692
|
this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentCurrent', 100, this.airPurifier?.log);
|
689
693
|
}
|
690
694
|
else if (newValue === FanControl.FanMode.On) {
|
695
|
+
this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentSettings', 100, this.airPurifier?.log);
|
691
696
|
this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentCurrent', 100, this.airPurifier?.log);
|
692
697
|
}
|
693
698
|
}, this.airPurifier.log);
|
@@ -725,7 +730,6 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
725
730
|
await this.airConditioner?.setAttribute(ThermostatCluster.id, 'localTemperature', 20 * 100, this.airConditioner?.log);
|
726
731
|
await this.airConditioner?.setAttribute(TemperatureMeasurement.Cluster.id, 'measuredValue', 20 * 100, this.airConditioner?.log);
|
727
732
|
await this.airConditioner?.setAttribute(RelativeHumidityMeasurementCluster.id, 'measuredValue', 50 * 100, this.airConditioner?.log);
|
728
|
-
await this.airConditioner?.setAttribute(FanControl.Cluster.id, 'speedSetting', 50, this.airConditioner?.log);
|
729
733
|
await this.airConditioner?.setAttribute(FanControl.Cluster.id, 'percentSetting', 50, this.airConditioner?.log);
|
730
734
|
});
|
731
735
|
this.airConditioner?.addCommandHandler('off', async () => {
|
@@ -733,7 +737,6 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
733
737
|
await this.airConditioner?.setAttribute(ThermostatCluster.id, 'localTemperature', null, this.airConditioner?.log);
|
734
738
|
await this.airConditioner?.setAttribute(TemperatureMeasurement.Cluster.id, 'measuredValue', null, this.airConditioner?.log);
|
735
739
|
await this.airConditioner?.setAttribute(RelativeHumidityMeasurementCluster.id, 'measuredValue', null, this.airConditioner?.log);
|
736
|
-
await this.airConditioner?.setAttribute(FanControl.Cluster.id, 'speedSetting', null, this.airConditioner?.log);
|
737
740
|
await this.airConditioner?.setAttribute(FanControl.Cluster.id, 'percentSetting', null, this.airConditioner?.log);
|
738
741
|
});
|
739
742
|
this.pump = new MatterbridgeEndpoint([pumpDevice, bridgedNode, powerSource], { uniqueStorageKey: 'Pump' }, this.config.debug)
|
@@ -830,13 +833,6 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
830
833
|
if (isValidNumber(newValue, 0, 100))
|
831
834
|
this.fan?.setAttribute(FanControl.Cluster.id, 'percentCurrent', newValue, this.fan?.log);
|
832
835
|
}, this.fan.log);
|
833
|
-
await this.fan?.subscribeAttribute(FanControl.Cluster.id, 'speedSetting', (newValue, oldValue, context) => {
|
834
|
-
this.fan?.log.info(`Speed setting changed from ${oldValue} to ${newValue} context: ${context.offline === true ? 'offline' : 'online'}`);
|
835
|
-
if (context.offline === true)
|
836
|
-
return;
|
837
|
-
if (isValidNumber(newValue, 0, 100))
|
838
|
-
this.fan?.setAttribute(FanControl.Cluster.id, 'speedCurrent', newValue, this.fan?.log);
|
839
|
-
}, this.fan.log);
|
840
836
|
this.waterLeak = new MatterbridgeEndpoint([waterLeakDetector, bridgedNode, powerSource], { uniqueStorageKey: 'Water leak detector' }, this.config.debug)
|
841
837
|
.createDefaultBridgedDeviceBasicInformationClusterServer('Water leak detector', 'serial_98745631222', 0xfff1, 'Matterbridge', 'Matterbridge WaterLeakDetector', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
|
842
838
|
.createDefaultPowerSourceRechargeableBatteryClusterServer()
|
@@ -1219,12 +1215,10 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
1219
1215
|
}
|
1220
1216
|
}, 60 * 1000 + 550);
|
1221
1217
|
}
|
1222
|
-
this.fan?.log.info('Set fan initial fanMode to Auto, percentCurrent and percentSetting to 50
|
1218
|
+
this.fan?.log.info('Set fan initial fanMode to Auto, percentCurrent and percentSetting to 50');
|
1223
1219
|
await this.fan?.setAttribute(FanControl.Cluster.id, 'fanMode', FanControl.FanMode.Auto, this.fan.log);
|
1224
1220
|
await this.fan?.setAttribute(FanControl.Cluster.id, 'percentCurrent', 50, this.fan.log);
|
1225
1221
|
await this.fan?.setAttribute(FanControl.Cluster.id, 'percentSetting', 50, this.fan.log);
|
1226
|
-
await this.fan?.setAttribute(FanControl.Cluster.id, 'speedCurrent', 50, this.fan.log);
|
1227
|
-
await this.fan?.setAttribute(FanControl.Cluster.id, 'speedSetting', 50, this.fan.log);
|
1228
1222
|
if (this.config.useInterval) {
|
1229
1223
|
this.fanInterval = setInterval(async () => {
|
1230
1224
|
const mode = this.fan?.getAttribute(FanControl.Cluster.id, 'fanMode', this.fan.log);
|
package/npm-shrinkwrap.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "matterbridge-example-dynamic-platform",
|
3
|
-
"version": "1.2.4-dev-
|
3
|
+
"version": "1.2.4-dev-20250613-639b0ce",
|
4
4
|
"lockfileVersion": 3,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "matterbridge-example-dynamic-platform",
|
9
|
-
"version": "1.2.4-dev-
|
9
|
+
"version": "1.2.4-dev-20250613-639b0ce",
|
10
10
|
"license": "MIT",
|
11
11
|
"dependencies": {
|
12
12
|
"node-ansi-logger": "3.0.1",
|
package/package.json
CHANGED