matterbridge-example-accessory-platform 1.1.5-dev.1 → 1.1.5-dev.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 CHANGED
@@ -8,9 +8,9 @@ If you like this project and find it useful, please consider giving it a star on
8
8
 
9
9
  ### Changed
10
10
 
11
- - [package]: Require matterbridge 2.1.0.
12
- - [package]: Updated dependencies.
13
11
  - [package]: Updated package.
12
+ - [package]: Updated dependencies.
13
+ - [package]: Require matterbridge 2.1.0.
14
14
 
15
15
  <a href="https://www.buymeacoffee.com/luligugithub">
16
16
  <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
package/dist/platform.js CHANGED
@@ -1,5 +1,6 @@
1
- import { MatterbridgeAccessoryPlatform, WindowCovering, powerSource, WindowCoveringCluster, MatterbridgeEndpoint, coverDevice, } from 'matterbridge';
1
+ import { MatterbridgeAccessoryPlatform, powerSource, MatterbridgeEndpoint, coverDevice } from 'matterbridge';
2
2
  import { isValidNumber } from 'matterbridge/utils';
3
+ import { WindowCovering } from 'matterbridge/matter/clusters';
3
4
  export class ExampleMatterbridgeAccessoryPlatform extends MatterbridgeAccessoryPlatform {
4
5
  cover;
5
6
  coverInterval;
@@ -19,9 +20,6 @@ export class ExampleMatterbridgeAccessoryPlatform extends MatterbridgeAccessoryP
19
20
  this.cover.createDefaultWindowCoveringClusterServer(10000);
20
21
  this.cover.createDefaultPowerSourceWiredClusterServer();
21
22
  await this.registerDevice(this.cover);
22
- this.cover.subscribeAttribute(WindowCoveringCluster.id, 'mode', (newValue, oldValue) => {
23
- this.cover?.log.info(`Attribute mode changed from ${oldValue} to ${newValue}. Reverse: ${newValue.motorDirectionReversed}. Calibration: ${newValue.calibrationMode}. Maintenance: ${newValue.maintenanceMode}. LED: ${newValue.ledFeedback}`);
24
- }, this.log);
25
23
  this.cover.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
26
24
  this.cover?.log.info(`Command identify called identifyTime: ${identifyTime}`);
27
25
  });
@@ -50,7 +48,7 @@ export class ExampleMatterbridgeAccessoryPlatform extends MatterbridgeAccessoryP
50
48
  this.coverInterval = setInterval(async () => {
51
49
  if (!this.cover)
52
50
  return;
53
- let position = this.cover.getAttribute(WindowCoveringCluster.id, 'currentPositionLiftPercent100ths', this.log);
51
+ let position = this.cover.getAttribute(WindowCovering.Cluster.id, 'currentPositionLiftPercent100ths', this.log);
54
52
  if (!isValidNumber(position, 0, 10000))
55
53
  return;
56
54
  position = position + 1000;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-example-accessory-platform",
3
- "version": "1.1.5-dev.1",
3
+ "version": "1.1.5-dev.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-example-accessory-platform",
9
- "version": "1.1.5-dev.1",
9
+ "version": "1.1.5-dev.3",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "node-ansi-logger": "3.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-example-accessory-platform",
3
- "version": "1.1.5-dev.1",
3
+ "version": "1.1.5-dev.3",
4
4
  "description": "Matterbridge accessory plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "MIT",