matterbridge-eve-motion 1.3.0-dev-20250626-4975a59 → 1.3.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 CHANGED
@@ -1,7 +1,47 @@
1
- # Changelog
1
+ # <img src="matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge eve motion Changelog
2
+
3
+ [![npm version](https://img.shields.io/npm/v/matterbridge-eve-motion.svg)](https://www.npmjs.com/package/matterbridge-eve-motion)
4
+ [![npm downloads](https://img.shields.io/npm/dt/matterbridge-eve-motion.svg)](https://www.npmjs.com/package/matterbridge-eve-motion)
5
+ [![Docker Version](https://img.shields.io/docker/v/luligu/matterbridge?label=docker%20version&sort=semver)](https://hub.docker.com/r/luligu/matterbridge)
6
+ [![Docker Pulls](https://img.shields.io/docker/pulls/luligu/matterbridge.svg)](https://hub.docker.com/r/luligu/matterbridge)
7
+ ![Node.js CI](https://github.com/Luligu/matterbridge-eve-motion/actions/workflows/build-matterbridge-plugin.yml/badge.svg)
8
+ ![CodeQL](https://github.com/Luligu/matterbridge-eve-motion/actions/workflows/codeql.yml/badge.svg)
9
+ [![codecov](https://codecov.io/gh/Luligu/matterbridge-eve-motion/branch/main/graph/badge.svg)](https://codecov.io/gh/Luligu/mmatterbridge-eve-motion)
10
+
11
+ [![power by](https://img.shields.io/badge/powered%20by-matterbridge-blue)](https://www.npmjs.com/package/matterbridge)
12
+ [![power by](https://img.shields.io/badge/powered%20by-matter--history-blue)](https://www.npmjs.com/package/matter-history)
13
+ [![power by](https://img.shields.io/badge/powered%20by-node--ansi--logger-blue)](https://www.npmjs.com/package/node-ansi-logger)
14
+ [![power by](https://img.shields.io/badge/powered%20by-node--persist--manager-blue)](https://www.npmjs.com/package/node-persist-manager)
15
+
16
+ ---
2
17
 
3
18
  All notable changes to this project will be documented in this file.
4
19
 
20
+ ## [1.3.0] - 2025-06-26
21
+
22
+ ### Added
23
+
24
+ - [DevContainer]: Added support for the **Matterbridge Dev Container** with an optimized named volume for `node_modules`.
25
+ - [GitHub]: Added GitHub issue templates for bug reports and feature requests.
26
+ - [ESLint]: Refactored the flat config.
27
+ - [ESLint]: Added the plugins `eslint-plugin-promise`, `eslint-plugin-jsdoc`, and `@vitest/eslint-plugin`.
28
+ - [Jest]: Refactored the flat config.
29
+ - [Vitest]: Added Vitest for TypeScript project testing. It will replace Jest, which does not work correctly with ESM module mocks.
30
+ - [JSDoc]: Added missing JSDoc comments, including `@param` and `@returns` tags.
31
+ - [CodeQL]: Added CodeQL badge in the readme.
32
+ - [Codecov]: Added Codecov badge in the readme.
33
+
34
+ ### Changed
35
+
36
+ - [package]: Updated package to Automator v. 2.0.1.
37
+ - [package]: Updated dependencies.
38
+ - [storage]: Bumped `node-storage-manager` to 2.0.0.
39
+ - [logger]: Bumped `node-ansi-logger` to 3.1.1.
40
+
41
+ <a href="https://www.buymeacoffee.com/luligugithub">
42
+ <img src="bmc-button.svg" alt="Buy me a coffee" width="80">
43
+ </a>
44
+
5
45
  ## [1.2.3] - 2025-04-30
6
46
 
7
47
  ### Changed
@@ -11,7 +51,7 @@ All notable changes to this project will be documented in this file.
11
51
  - [package]: Update dependencies.
12
52
 
13
53
  <a href="https://www.buymeacoffee.com/luligugithub">
14
- <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
54
+ <img src="bmc-button.svg" alt="Buy me a coffee" width="80">
15
55
  </a>
16
56
 
17
57
  ## [1.2.2] - 2025-04-03
@@ -23,7 +63,7 @@ All notable changes to this project will be documented in this file.
23
63
  - [package]: Update dependencies.
24
64
 
25
65
  <a href="https://www.buymeacoffee.com/luligugithub">
26
- <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
66
+ <img src="bmc-button.svg" alt="Buy me a coffee" width="80">
27
67
  </a>
28
68
 
29
69
  ## [1.2.1] - 2025-02-01
@@ -35,7 +75,7 @@ All notable changes to this project will be documented in this file.
35
75
  - [package]: Update dependencies.
36
76
 
37
77
  <a href="https://www.buymeacoffee.com/luligugithub">
38
- <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
78
+ <img src="bmc-button.svg" alt="Buy me a coffee" width="80">
39
79
  </a>
40
80
 
41
81
  ## [1.1.0] - 2024-12-14
@@ -48,7 +88,7 @@ All notable changes to this project will be documented in this file.
48
88
  - [package]: Update dependencies.
49
89
 
50
90
  <a href="https://www.buymeacoffee.com/luligugithub">
51
- <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
91
+ <img src="bmc-button.svg" alt="Buy me a coffee" width="80">
52
92
  </a>
53
93
 
54
94
  <!-- Commented out section
package/README.md CHANGED
@@ -1,11 +1,12 @@
1
- # <img src="https://github.com/Luligu/matterbridge/blob/main/frontend/public/matterbridge%2064x64.png" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge eve motion with history
1
+ # <img src="matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge eve motion with history
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge-eve-motion.svg)](https://www.npmjs.com/package/matterbridge-eve-motion)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge-eve-motion.svg)](https://www.npmjs.com/package/matterbridge-eve-motion)
5
5
  [![Docker Version](https://img.shields.io/docker/v/luligu/matterbridge?label=docker%20version&sort=semver)](https://hub.docker.com/r/luligu/matterbridge)
6
6
  [![Docker Pulls](https://img.shields.io/docker/pulls/luligu/matterbridge.svg)](https://hub.docker.com/r/luligu/matterbridge)
7
7
  ![Node.js CI](https://github.com/Luligu/matterbridge-eve-motion/actions/workflows/build-matterbridge-plugin.yml/badge.svg)
8
- ![Coverage](https://img.shields.io/badge/Jest%20coverage-100%25-brightgreen)
8
+ ![CodeQL](https://github.com/Luligu/matterbridge-eve-motion/actions/workflows/codeql.yml/badge.svg)
9
+ [![codecov](https://codecov.io/gh/Luligu/matterbridge-eve-motion/branch/main/graph/badge.svg)](https://codecov.io/gh/Luligu/mmatterbridge-eve-motion)
9
10
 
10
11
  [![power by](https://img.shields.io/badge/powered%20by-matterbridge-blue)](https://www.npmjs.com/package/matterbridge)
11
12
  [![power by](https://img.shields.io/badge/powered%20by-matter--history-blue)](https://www.npmjs.com/package/matter-history)
package/dist/platform.js CHANGED
@@ -5,6 +5,7 @@ export class EveMotionPlatform extends MatterbridgeAccessoryPlatform {
5
5
  motion;
6
6
  history;
7
7
  interval;
8
+ occupied = false;
8
9
  constructor(matterbridge, log, config) {
9
10
  super(matterbridge, log, config);
10
11
  if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.0.0')) {
@@ -40,17 +41,13 @@ export class EveMotionPlatform extends MatterbridgeAccessoryPlatform {
40
41
  this.interval = setInterval(async () => {
41
42
  if (!this.motion || !this.history)
42
43
  return;
43
- const occupancyAttribute = this.motion.getAttribute(OccupancySensing.Cluster.id, 'occupancy', this.log);
44
- if (!occupancyAttribute)
45
- return;
46
- let { occupied } = occupancyAttribute;
47
- occupied = !occupied;
44
+ this.occupied = !this.occupied;
48
45
  const lux = this.history.getFakeLevel(0, 1000, 0);
49
- await this.motion.setAttribute(OccupancySensing.Cluster.id, 'occupancy', { occupied }, this.log);
46
+ await this.motion.setAttribute(OccupancySensing.Cluster.id, 'occupancy', { occupied: this.occupied }, this.log);
50
47
  await this.motion.setAttribute(IlluminanceMeasurement.Cluster.id, 'measuredValue', Math.round(Math.max(Math.min(10000 * Math.log10(lux) + 1, 0xfffe), 0)), this.log);
51
48
  this.history.setLastEvent();
52
- this.history.addEntry({ time: this.history.now(), motion: occupied === true ? 0 : 1, lux });
53
- this.log.info(`Set motion to ${occupied} and lux to ${lux}`);
49
+ this.history.addEntry({ time: this.history.now(), motion: this.occupied === true ? 0 : 1, lux });
50
+ this.log.info(`Set motion to ${this.occupied} and lux to ${lux}`);
54
51
  }, 60 * 1000 + 200);
55
52
  }
56
53
  async onShutdown(reason) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-eve-motion",
3
- "version": "1.3.0-dev-20250626-4975a59",
3
+ "version": "1.3.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-eve-motion",
9
- "version": "1.3.0-dev-20250626-4975a59",
9
+ "version": "1.3.0",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "matter-history": "1.1.18",
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-eve-motion",
3
- "version": "1.3.0-dev-20250626-4975a59",
3
+ "version": "1.3.0",
4
4
  "description": "Matterbridge eve motion with history",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
+ "homepage": "https://www.npmjs.com/package/matterbridge-eve-motion",
9
10
  "repository": {
10
11
  "type": "git",
11
12
  "url": "git+https://github.com/Luligu/matterbridge-eve-motion.git"