matterbridge-eve-weather 1.2.2 → 1.2.3
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 +12 -0
- package/dist/platform.js +15 -5
- package/npm-shrinkwrap.json +6 -2
- package/package.json +5 -1
- package/tsconfig.jest.json +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.2.3] - 2025-04-30
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- [package]: Require Matterbridge 3.0.0.
|
|
10
|
+
- [package]: Update dependencies.
|
|
11
|
+
- [package]: Update package.
|
|
12
|
+
|
|
13
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
14
|
+
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
|
|
15
|
+
</a>
|
|
16
|
+
|
|
5
17
|
## [1.2.2] - 2025-04-03
|
|
6
18
|
|
|
7
19
|
### Changed
|
package/dist/platform.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MatterbridgeAccessoryPlatform, powerSource, MatterbridgeEndpoint, temperatureSensor, humiditySensor, pressureSensor } from 'matterbridge';
|
|
2
2
|
import { PowerSource, PressureMeasurement, RelativeHumidityMeasurement, TemperatureMeasurement } from 'matterbridge/matter/clusters';
|
|
3
|
-
import { MatterHistory } from 'matter-history';
|
|
3
|
+
import { EveHistory, MatterHistory } from 'matter-history';
|
|
4
4
|
export class EveWeatherPlatform extends MatterbridgeAccessoryPlatform {
|
|
5
5
|
weather;
|
|
6
6
|
history;
|
|
@@ -9,8 +9,8 @@ export class EveWeatherPlatform extends MatterbridgeAccessoryPlatform {
|
|
|
9
9
|
maxTemperature = 0;
|
|
10
10
|
constructor(matterbridge, log, config) {
|
|
11
11
|
super(matterbridge, log, config);
|
|
12
|
-
if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('
|
|
13
|
-
throw new Error(`This plugin requires Matterbridge version >= "
|
|
12
|
+
if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.0.0')) {
|
|
13
|
+
throw new Error(`This plugin requires Matterbridge version >= "3.0.0". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend."`);
|
|
14
14
|
}
|
|
15
15
|
this.log.info('Initializing platform:', this.config.name);
|
|
16
16
|
}
|
|
@@ -38,6 +38,10 @@ export class EveWeatherPlatform extends MatterbridgeAccessoryPlatform {
|
|
|
38
38
|
}
|
|
39
39
|
async onConfigure() {
|
|
40
40
|
this.log.info('onConfigure called');
|
|
41
|
+
await this.weather?.setAttribute(EveHistory.Cluster.id, 'elevation', 250);
|
|
42
|
+
await this.weather?.setAttribute(EveHistory.Cluster.id, 'weatherTrend', 1);
|
|
43
|
+
await this.weather?.setAttribute(EveHistory.Cluster.id, 'temperatureDisplayUnits', 0);
|
|
44
|
+
await this.weather?.setAttribute(EveHistory.Cluster.id, 'airPressure', 950);
|
|
41
45
|
this.interval = setInterval(async () => {
|
|
42
46
|
if (!this.weather || !this.history)
|
|
43
47
|
return;
|
|
@@ -50,11 +54,17 @@ export class EveWeatherPlatform extends MatterbridgeAccessoryPlatform {
|
|
|
50
54
|
this.maxTemperature = Math.max(this.maxTemperature, temperature);
|
|
51
55
|
const humidity = this.history.getFakeLevel(1, 99, 2);
|
|
52
56
|
const pressure = this.history.getFakeLevel(700, 1100, 1);
|
|
53
|
-
await this.weather.setAttribute(TemperatureMeasurement.Cluster.id, 'minMeasuredValue', this.minTemperature * 100, this.log);
|
|
54
|
-
await this.weather.setAttribute(TemperatureMeasurement.Cluster.id, 'maxMeasuredValue', this.maxTemperature * 100, this.log);
|
|
55
57
|
await this.weather.setAttribute(TemperatureMeasurement.Cluster.id, 'measuredValue', temperature * 100, this.log);
|
|
56
58
|
await this.weather.setAttribute(RelativeHumidityMeasurement.Cluster.id, 'measuredValue', humidity * 100, this.log);
|
|
57
59
|
await this.weather.setAttribute(PressureMeasurement.Cluster.id, 'measuredValue', pressure, this.log);
|
|
60
|
+
this.weather.setAttribute(EveHistory.Cluster.id, 'weatherTrend', 1);
|
|
61
|
+
if (pressure < 800)
|
|
62
|
+
await this.weather.setAttribute(EveHistory.Cluster.id, 'weatherTrend', 12);
|
|
63
|
+
else if (pressure < 900)
|
|
64
|
+
await this.weather.setAttribute(EveHistory.Cluster.id, 'weatherTrend', 5);
|
|
65
|
+
else if (pressure < 1000)
|
|
66
|
+
await this.weather.setAttribute(EveHistory.Cluster.id, 'weatherTrend', 3);
|
|
67
|
+
await this.weather.setAttribute(EveHistory.Cluster.id, 'airPressure', pressure);
|
|
58
68
|
this.history.setMaxMinTemperature(this.maxTemperature, this.minTemperature);
|
|
59
69
|
this.history.addEntry({ time: this.history.now(), temperature, humidity, pressure });
|
|
60
70
|
this.log.info(`Set temperature: ${temperature} (min: ${this.minTemperature} max: ${this.maxTemperature}) humidity: ${humidity} pressure: ${pressure}`);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-eve-weather",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-eve-weather",
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.3",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"matter-history": "1.1.18",
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=22.0.0"
|
|
18
|
+
},
|
|
19
|
+
"funding": {
|
|
20
|
+
"type": "buymeacoffee",
|
|
21
|
+
"url": "https://www.buymeacoffee.com/luligugithub"
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
"node_modules/matter-history": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-eve-weather",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Matterbridge eve weather with history",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/Luligu/matterbridge-eve-weather/issues"
|
|
15
15
|
},
|
|
16
|
+
"funding": {
|
|
17
|
+
"type": "buymeacoffee",
|
|
18
|
+
"url": "https://www.buymeacoffee.com/luligugithub"
|
|
19
|
+
},
|
|
16
20
|
"keywords": [
|
|
17
21
|
"matterbridge",
|
|
18
22
|
"homebridge",
|