matterbridge-eve-motion 2.0.11 → 3.0.0
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 +24 -2
- package/README.md +20 -2
- package/dist/module.js +8 -8
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|

|
|
10
10
|

|
|
11
11
|
[](https://codecov.io/gh/Luligu/mmatterbridge-eve-motion)
|
|
12
|
-
[](https://vitest.dev)
|
|
13
|
+
[](https://oxc.rs/docs/guide/usage/formatter.html)
|
|
14
|
+
[](https://oxc.rs/docs/guide/usage/linter.html)
|
|
14
15
|
[](https://www.typescriptlang.org/)
|
|
16
|
+
[](https://github.com/microsoft/typescript-go)
|
|
15
17
|
[](https://nodejs.org/)
|
|
16
18
|
[](https://matterbridge.io)
|
|
17
19
|
|
|
@@ -28,6 +30,26 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
28
30
|
|
|
29
31
|
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
|
|
30
32
|
|
|
33
|
+
## [3.0.0] - Dev branch
|
|
34
|
+
|
|
35
|
+
### Breaking changes
|
|
36
|
+
|
|
37
|
+
- [matterbridge]: Require matterbridge v.3.9.0 with matter v.1.5.1 and matter.js v.0.17.1.
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
|
|
41
|
+
- [package]: Update dependencies.
|
|
42
|
+
- [package]: Bump package to `automator` v.3.1.12.
|
|
43
|
+
- [workflow]: Bump `.github\workflows\build.yml` config to v.2.0.4.
|
|
44
|
+
- [workflow]: Bump `.github\workflows\codecov.yml` config to v.2.0.5.
|
|
45
|
+
- [workflow]: Bump `.github\workflows\publish.yml` config to v.2.0.4.
|
|
46
|
+
- [oxlint]: Bump `oxlint` config to v.1.0.13.
|
|
47
|
+
- [oxfmt]: Bump `oxfmt` config to v.1.0.3.
|
|
48
|
+
- [devcontainer]: Bump `.devcontainer/devcontainer.json` config to v.1.0.4.
|
|
49
|
+
- [package]: Bump `.vscode/extensions.json` config to v.1.0.4.
|
|
50
|
+
|
|
51
|
+
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
|
|
52
|
+
|
|
31
53
|
## [2.0.11] - 2026-06-05
|
|
32
54
|
|
|
33
55
|
### Breaking changes
|
package/README.md
CHANGED
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|

|
|
8
8
|

|
|
9
9
|
[](https://codecov.io/gh/Luligu/mmatterbridge-eve-motion)
|
|
10
|
-
[](https://vitest.dev)
|
|
11
|
+
[](https://oxc.rs/docs/guide/usage/formatter.html)
|
|
12
|
+
[](https://oxc.rs/docs/guide/usage/linter.html)
|
|
12
13
|
[](https://www.typescriptlang.org/)
|
|
14
|
+
[](https://github.com/microsoft/typescript-go)
|
|
13
15
|
[](https://nodejs.org/)
|
|
14
16
|
[](https://matterbridge.io)
|
|
15
17
|
|
|
@@ -33,3 +35,19 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
33
35
|
### Matterbridge
|
|
34
36
|
|
|
35
37
|
See the guidelines on [Matterbridge](https://matterbridge.io) for more information.
|
|
38
|
+
|
|
39
|
+
## Repository setup
|
|
40
|
+
|
|
41
|
+
> **Note:** This repository uses a new toolchain. It replaces the traditional TypeScript / ESLint / Prettier / Jest stack with a faster, lighter setup.
|
|
42
|
+
|
|
43
|
+
- **No `typescript` package** — replaced by [TypeScript Native](https://github.com/microsoft/typescript-go). The `typescript` package is kept only as a publish-time dependency while tsgo is still in preview.
|
|
44
|
+
- **No ESLint, no Prettier** — replaced by the [oxc](https://oxc.rs) stack: [oxlint](https://oxc.rs/docs/guide/usage/linter.html) for linting and [oxfmt](https://oxc.rs/docs/guide/usage/formatter.html) for formatting.
|
|
45
|
+
- **No Jest** — replaced by [Vitest](https://vitest.dev), which is much faster and natively supports ESM without extra configuration.
|
|
46
|
+
- **Far fewer development dependencies** — the number of installed packages drops from **~600** to **~100**. A clean install is much faster.
|
|
47
|
+
- **Much faster linting and formatting** — oxlint and oxfmt run in a fraction of the time required by the ESLint / Prettier pipeline.
|
|
48
|
+
- **Much faster builds** — tsgo compiles the project in a fraction of the time required by the standard `tsc` build.
|
|
49
|
+
- **Editor support** — use the VS Code extensions for tsgo and oxc to get the same experience in the editor.
|
|
50
|
+
|
|
51
|
+
## Style guide
|
|
52
|
+
|
|
53
|
+
See also the [Style Guide](./STYLEGUIDE.md) for JSDoc, naming, and logging conventions used in this repository.
|
package/dist/module.js
CHANGED
|
@@ -12,8 +12,8 @@ export class EveMotionPlatform extends MatterbridgeAccessoryPlatform {
|
|
|
12
12
|
occupied = false;
|
|
13
13
|
constructor(matterbridge, log, config) {
|
|
14
14
|
super(matterbridge, log, config);
|
|
15
|
-
if (
|
|
16
|
-
throw new Error(`This plugin requires Matterbridge version >= "3.
|
|
15
|
+
if (typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.9.0')) {
|
|
16
|
+
throw new Error(`This plugin requires Matterbridge version >= "3.9.0". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend."`);
|
|
17
17
|
}
|
|
18
18
|
this.log.info('Initializing platform:', this.config.name);
|
|
19
19
|
}
|
|
@@ -42,18 +42,18 @@ export class EveMotionPlatform extends MatterbridgeAccessoryPlatform {
|
|
|
42
42
|
async onConfigure() {
|
|
43
43
|
await super.onConfigure();
|
|
44
44
|
this.log.info('onConfigure called');
|
|
45
|
-
await this.motion?.setAttribute(OccupancySensing
|
|
46
|
-
await this.motion?.setAttribute(IlluminanceMeasurement
|
|
45
|
+
await this.motion?.setAttribute(OccupancySensing, 'occupancy', { occupied: false }, this.log);
|
|
46
|
+
await this.motion?.setAttribute(IlluminanceMeasurement, 'measuredValue', Math.round(Math.max(Math.min(10000 * Math.log10(500) + 1, 0xfffe), 0)), this.log);
|
|
47
47
|
this.interval = setInterval(() => {
|
|
48
48
|
fireAndForget((async () => {
|
|
49
49
|
if (!this.motion || !this.history)
|
|
50
50
|
return;
|
|
51
51
|
this.occupied = !this.occupied;
|
|
52
52
|
const lux = this.history.getFakeLevel(0, 1000, 0);
|
|
53
|
-
await this.motion.setAttribute(OccupancySensing
|
|
54
|
-
await this.motion.setAttribute(IlluminanceMeasurement
|
|
53
|
+
await this.motion.setAttribute(OccupancySensing, 'occupancy', { occupied: this.occupied }, this.log);
|
|
54
|
+
await this.motion.setAttribute(IlluminanceMeasurement, 'measuredValue', Math.round(Math.max(Math.min(10000 * Math.log10(lux) + 1, 0xfffe), 0)), this.log);
|
|
55
55
|
this.history.setLastEvent();
|
|
56
|
-
this.history.addEntry({ time: this.history.now(), motion: this.occupied
|
|
56
|
+
this.history.addEntry({ time: this.history.now(), motion: this.occupied ? 0 : 1, lux });
|
|
57
57
|
this.log.info(`Set motion to ${this.occupied} and lux to ${lux}`);
|
|
58
58
|
})(), this.log, 'setInterval');
|
|
59
59
|
}, 60 * 1000 + 200);
|
|
@@ -63,7 +63,7 @@ export class EveMotionPlatform extends MatterbridgeAccessoryPlatform {
|
|
|
63
63
|
this.log.info('onShutdown called with reason:', reason ?? 'none');
|
|
64
64
|
await this.history?.close();
|
|
65
65
|
clearInterval(this.interval);
|
|
66
|
-
if (this.config.unregisterOnShutdown
|
|
66
|
+
if (this.config.unregisterOnShutdown)
|
|
67
67
|
await this.unregisterAllDevices();
|
|
68
68
|
}
|
|
69
69
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-eve-motion",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-eve-motion",
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "3.0.0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"matter-history": "1.2.2",
|