matterbridge-eve-door 1.1.0 → 1.2.0-dev.1

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
@@ -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.0-dev.1] - 2025-02-01
6
+
7
+ ### Changed
8
+
9
+ - [package]: Require Matterbridge 2.1.0.
10
+ - [package]: Update package.
11
+ - [package]: Update dependencies.
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.1.0] - 2024-12-14
6
18
 
7
19
  ### Added
package/dist/platform.js CHANGED
@@ -1,28 +1,20 @@
1
- import { BooleanState, MatterbridgeDevice, MatterbridgeAccessoryPlatform, powerSource, MatterbridgeEndpoint, contactSensor, PowerSource, } from 'matterbridge';
1
+ import { BooleanState, MatterbridgeAccessoryPlatform, powerSource, MatterbridgeEndpoint, contactSensor, PowerSource } from 'matterbridge';
2
2
  import { MatterHistory } from 'matter-history';
3
3
  export class EveDoorPlatform extends MatterbridgeAccessoryPlatform {
4
4
  door;
5
5
  history;
6
6
  interval;
7
- createMutableDevice(definition, options = {}, debug = false) {
8
- let device;
9
- if (this.matterbridge.edge === true)
10
- device = new MatterbridgeEndpoint(definition, options, debug);
11
- else
12
- device = new MatterbridgeDevice(definition, options, debug);
13
- return device;
14
- }
15
7
  constructor(matterbridge, log, config) {
16
8
  super(matterbridge, log, config);
17
- if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('1.6.6')) {
18
- throw new Error(`This plugin requires Matterbridge version >= "1.6.6". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend."`);
9
+ if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('2.1.0')) {
10
+ throw new Error(`This plugin requires Matterbridge version >= "2.1.0". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend."`);
19
11
  }
20
12
  this.log.info('Initializing platform:', this.config.name);
21
13
  }
22
14
  async onStart(reason) {
23
15
  this.log.info('onStart called with reason:', reason ?? 'none');
24
16
  this.history = new MatterHistory(this.log, 'Eve door', { filePath: this.matterbridge.matterbridgeDirectory, edge: this.matterbridge.edge });
25
- this.door = this.createMutableDevice([contactSensor, powerSource], { uniqueStorageKey: 'EveDoor' }, this.config.debug);
17
+ this.door = new MatterbridgeEndpoint([contactSensor, powerSource], { uniqueStorageKey: 'Eve door' }, this.config.debug);
26
18
  this.door.createDefaultIdentifyClusterServer();
27
19
  this.door.createDefaultBasicInformationClusterServer('Eve door', '0x88030475', 4874, 'Eve Systems', 77, 'Eve Door 20EBN9901', 1144, '1.2.8');
28
20
  this.door.createDefaultBooleanStateClusterServer(true);
@@ -31,11 +23,11 @@ export class EveDoorPlatform extends MatterbridgeAccessoryPlatform {
31
23
  this.history.autoPilot(this.door);
32
24
  await this.registerDevice(this.door);
33
25
  this.door.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
34
- this.log.warn(`Command identify called identifyTime ${identifyTime}`);
26
+ this.log.info(`Command identify called identifyTime ${identifyTime}`);
35
27
  this.history?.logHistory(false);
36
28
  });
37
29
  this.door.addCommandHandler('triggerEffect', async ({ request: { effectIdentifier, effectVariant } }) => {
38
- this.log.warn(`Command triggerEffect called effect ${effectIdentifier} variant ${effectVariant}`);
30
+ this.log.info(`Command triggerEffect called effect ${effectIdentifier} variant ${effectVariant}`);
39
31
  this.history?.logHistory(false);
40
32
  });
41
33
  }
@@ -47,8 +39,7 @@ export class EveDoorPlatform extends MatterbridgeAccessoryPlatform {
47
39
  let contact = this.door.getAttribute(BooleanState.Cluster.id, 'stateValue', this.log);
48
40
  contact = !contact;
49
41
  await this.door.setAttribute(BooleanState.Cluster.id, 'stateValue', contact, this.log);
50
- if (!this.matterbridge.edge && this.door.number)
51
- this.door.triggerEvent(BooleanState.Cluster.id, 'stateChange', { stateValue: contact }, this.log);
42
+ await this.door.triggerEvent(BooleanState.Cluster.id, 'stateChange', { stateValue: contact }, this.log);
52
43
  if (contact === false)
53
44
  this.history.addToTimesOpened();
54
45
  this.history.setLastEvent();
@@ -62,6 +53,7 @@ export class EveDoorPlatform extends MatterbridgeAccessoryPlatform {
62
53
  this.log.info('onShutdown called with reason:', reason ?? 'none');
63
54
  await this.history?.close();
64
55
  clearInterval(this.interval);
56
+ this.interval = undefined;
65
57
  if (this.config.unregisterOnShutdown === true)
66
58
  await this.unregisterAllDevices();
67
59
  }
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "matterbridge-eve-door",
3
- "version": "1.1.0",
3
+ "version": "1.2.0-dev.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-eve-door",
9
- "version": "1.1.0",
9
+ "version": "1.2.0-dev.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "matter-history": "1.1.17-dev.6",
12
+ "matter-history": "1.1.17-dev.8",
13
13
  "node-ansi-logger": "3.0.0",
14
14
  "node-persist-manager": "1.0.8"
15
15
  },
@@ -18,9 +18,9 @@
18
18
  }
19
19
  },
20
20
  "node_modules/matter-history": {
21
- "version": "1.1.17-dev.6",
22
- "resolved": "https://registry.npmjs.org/matter-history/-/matter-history-1.1.17-dev.6.tgz",
23
- "integrity": "sha512-HcRofndO9PtE7wZ8K1Q0FXWPVucXS3tJBuYG6yk6+PkorWPdLlKYVBplKXzdY1zGY9zDiSB8CKAiPfst33vO2g==",
21
+ "version": "1.1.17-dev.8",
22
+ "resolved": "https://registry.npmjs.org/matter-history/-/matter-history-1.1.17-dev.8.tgz",
23
+ "integrity": "sha512-r/qr30WlJkLbmFVhF6fbeTPZFaLaznYBZVhZuPPAeCY0Y1FN+YdqKzUd59jAeSMQQZNGmPqOuHnOlrkzczKA1g==",
24
24
  "hasShrinkwrap": true,
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
@@ -71,10 +71,13 @@
71
71
  }
72
72
  },
73
73
  "node_modules/node-persist": {
74
- "version": "4.0.3",
75
- "resolved": "https://registry.npmjs.org/node-persist/-/node-persist-4.0.3.tgz",
76
- "integrity": "sha512-0gDy86TNShzfbpUKFbH8KJFjoovuUgVh/FqL4jrJWYz0cET76Uohl118utG/Ft6wl4sHOPXdRSY7eXH5kVY06w==",
74
+ "version": "4.0.4",
75
+ "resolved": "https://registry.npmjs.org/node-persist/-/node-persist-4.0.4.tgz",
76
+ "integrity": "sha512-8sPAz/7tw1mCCc8xBG4f0wi+flHkSSgQeX998iQ75Pu27evA6UUWCjSE7xnrYTg2q33oU5leJ061EKPDv6BocQ==",
77
77
  "license": "MIT",
78
+ "dependencies": {
79
+ "p-limit": "^3.1.0"
80
+ },
78
81
  "engines": {
79
82
  "node": ">=10.12.0"
80
83
  }
@@ -94,6 +97,33 @@
94
97
  "type": "buymeacoffee",
95
98
  "url": "https://www.buymeacoffee.com/luligugithub"
96
99
  }
100
+ },
101
+ "node_modules/p-limit": {
102
+ "version": "3.1.0",
103
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
104
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
105
+ "license": "MIT",
106
+ "dependencies": {
107
+ "yocto-queue": "^0.1.0"
108
+ },
109
+ "engines": {
110
+ "node": ">=10"
111
+ },
112
+ "funding": {
113
+ "url": "https://github.com/sponsors/sindresorhus"
114
+ }
115
+ },
116
+ "node_modules/yocto-queue": {
117
+ "version": "0.1.0",
118
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
119
+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
120
+ "license": "MIT",
121
+ "engines": {
122
+ "node": ">=10"
123
+ },
124
+ "funding": {
125
+ "url": "https://github.com/sponsors/sindresorhus"
126
+ }
97
127
  }
98
128
  }
99
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-eve-door",
3
- "version": "1.1.0",
3
+ "version": "1.2.0-dev.1",
4
4
  "description": "Matterbridge eve door with history",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "node": ">=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=22.0.0 <23.0.0"
28
28
  },
29
29
  "dependencies": {
30
- "matter-history": "1.1.17-dev.6",
30
+ "matter-history": "1.1.17-dev.8",
31
31
  "node-ansi-logger": "3.0.0",
32
32
  "node-persist-manager": "1.0.8"
33
33
  }