matterbridge-example-dynamic-platform 1.0.2 → 1.0.5

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/README.md CHANGED
@@ -11,3 +11,5 @@
11
11
  ---
12
12
 
13
13
  Matterbridge dynamic platform example plugin is a template to develop your own plugin using the dynamic platform.
14
+
15
+ See the guidelines on [Matterbridge](https://github.com/Luligu/matterbridge/blob/main/README.md) for more information.
package/dist/index.d.ts CHANGED
@@ -1,11 +1,14 @@
1
- import { Matterbridge } from 'matterbridge';
1
+ import { Matterbridge, PlatformConfig } from 'matterbridge';
2
2
  import { AnsiLogger } from 'node-ansi-logger';
3
3
  import { ExampleMatterbridgeDynamicPlatform } from './platform.js';
4
4
  /**
5
- * This is the standard interface for MatterBridge plugins.
5
+ * This is the standard interface for Matterbridge plugins.
6
6
  * Each plugin should export a default function that follows this signature.
7
7
  *
8
- * @param matterbridge - An instance of MatterBridge
8
+ * @param {Matterbridge} matterbridge - The Matterbridge instance.
9
+ * @param {AnsiLogger} log - The logger instance.
10
+ * @param {PlatformConfig} config - The platform configuration.
11
+ * @returns {ExampleMatterbridgeDynamicPlatform} The initialized platform.
9
12
  */
10
- export default function initializePlugin(matterbridge: Matterbridge, log: AnsiLogger): ExampleMatterbridgeDynamicPlatform;
13
+ export default function initializePlugin(matterbridge: Matterbridge, log: AnsiLogger, config: PlatformConfig): ExampleMatterbridgeDynamicPlatform;
11
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kCAAkC,EAAE,MAAM,eAAe,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,sCAEnF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kCAAkC,EAAE,MAAM,eAAe,CAAC;AAEnE;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,kCAAkC,CAEhJ"}
package/dist/index.js CHANGED
@@ -1,11 +1,14 @@
1
1
  import { ExampleMatterbridgeDynamicPlatform } from './platform.js';
2
2
  /**
3
- * This is the standard interface for MatterBridge plugins.
3
+ * This is the standard interface for Matterbridge plugins.
4
4
  * Each plugin should export a default function that follows this signature.
5
5
  *
6
- * @param matterbridge - An instance of MatterBridge
6
+ * @param {Matterbridge} matterbridge - The Matterbridge instance.
7
+ * @param {AnsiLogger} log - The logger instance.
8
+ * @param {PlatformConfig} config - The platform configuration.
9
+ * @returns {ExampleMatterbridgeDynamicPlatform} The initialized platform.
7
10
  */
8
- export default function initializePlugin(matterbridge, log) {
9
- return new ExampleMatterbridgeDynamicPlatform(matterbridge, log);
11
+ export default function initializePlugin(matterbridge, log, config) {
12
+ return new ExampleMatterbridgeDynamicPlatform(matterbridge, log, config);
10
13
  }
11
14
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kCAAkC,EAAE,MAAM,eAAe,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,YAA0B,EAAE,GAAe;IAClF,OAAO,IAAI,kCAAkC,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AACnE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kCAAkC,EAAE,MAAM,eAAe,CAAC;AAEnE;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,YAA0B,EAAE,GAAe,EAAE,MAAsB;IAC1G,OAAO,IAAI,kCAAkC,CAAC,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC3E,CAAC"}
@@ -1,9 +1,17 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { PlatformConfig } from 'matterbridge';
1
3
  import { Matterbridge, MatterbridgeDevice, MatterbridgeDynamicPlatform } from 'matterbridge';
2
4
  import { AnsiLogger } from 'node-ansi-logger';
3
5
  export declare class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatform {
4
- cover: MatterbridgeDevice | undefined;
6
+ switch: MatterbridgeDevice | undefined;
5
7
  light: MatterbridgeDevice | undefined;
6
- constructor(matterbridge: Matterbridge, log: AnsiLogger);
8
+ outlet: MatterbridgeDevice | undefined;
9
+ cover: MatterbridgeDevice | undefined;
10
+ switchInterval: NodeJS.Timeout | undefined;
11
+ lightInterval: NodeJS.Timeout | undefined;
12
+ outletInterval: NodeJS.Timeout | undefined;
13
+ coverInterval: NodeJS.Timeout | undefined;
14
+ constructor(matterbridge: Matterbridge, log: AnsiLogger, config: PlatformConfig);
7
15
  onStart(reason?: string): Promise<void>;
8
16
  onConfigure(): Promise<void>;
9
17
  onShutdown(reason?: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,kCAAmC,SAAQ,2BAA2B;IACjF,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACtC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAC;gBAE1B,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU;IAIxC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM;IAsCvB,WAAW;IAoDX,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM;CAG1C"}
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqF,cAAc,EAAsD,MAAM,cAAc,CAAC;AAErL,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,kCAAmC,SAAQ,2BAA2B;IACjF,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACtC,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACtC,cAAc,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;IAC1C,cAAc,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;gBAE9B,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc;IAIhE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM;IAqIvB,WAAW;IAwFX,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM;CAQ1C"}
package/dist/platform.js CHANGED
@@ -1,27 +1,40 @@
1
- import { DeviceTypes, OnOffCluster, WindowCovering, WindowCoveringCluster } from 'matterbridge';
1
+ import { ColorControl, ColorControlCluster, DeviceTypes, LevelControlCluster, OnOffCluster, WindowCovering, WindowCoveringCluster, onOffSwitch } from 'matterbridge';
2
2
  import { MatterbridgeDevice, MatterbridgeDynamicPlatform } from 'matterbridge';
3
3
  export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatform {
4
- cover;
4
+ switch;
5
5
  light;
6
- constructor(matterbridge, log) {
7
- super(matterbridge, log);
6
+ outlet;
7
+ cover;
8
+ switchInterval;
9
+ lightInterval;
10
+ outletInterval;
11
+ coverInterval;
12
+ constructor(matterbridge, log, config) {
13
+ super(matterbridge, log, config);
8
14
  }
9
15
  async onStart(reason) {
10
16
  this.log.info('onStart called with reason:', reason ?? 'none');
11
- this.cover = new MatterbridgeDevice(DeviceTypes.WINDOW_COVERING);
12
- this.cover.createDefaultIdentifyClusterServer();
13
- this.cover.createDefaultGroupsClusterServer();
14
- this.cover.createDefaultScenesClusterServer();
15
- this.cover.createDefaultBridgedDeviceBasicInformationClusterServer('Bridged device 1', '0x01020564', 0xfff1, 'Luligu', 'Dynamic device 1');
16
- this.cover.createDefaultPowerSourceRechargableBatteryClusterServer(86);
17
- this.cover.createDefaultWindowCoveringClusterServer();
18
- await this.registerDevice(this.cover);
19
- this.cover.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
17
+ // Create a switch device
18
+ this.switch = new MatterbridgeDevice(onOffSwitch);
19
+ this.switch.createDefaultIdentifyClusterServer();
20
+ this.switch.createDefaultGroupsClusterServer();
21
+ this.switch.createDefaultScenesClusterServer();
22
+ this.switch.createDefaultBridgedDeviceBasicInformationClusterServer('Bridged device 3', '0x23452164', 0xfff1, 'Luligu', 'Dynamic device 3');
23
+ this.switch.createDefaultPowerSourceRechargeableBatteryClusterServer(70);
24
+ this.switch.createDefaultOnOffClusterServer();
25
+ await this.registerDevice(this.switch);
26
+ this.switch.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
20
27
  this.log.info(`Command identify called identifyTime:${identifyTime}`);
21
28
  });
22
- this.cover.addCommandHandler('goToLiftPercentage', async ({ request: { liftPercent100thsValue } }) => {
23
- this.log.info(`Command goToLiftPercentage called liftPercent100thsValue:${liftPercent100thsValue}`);
29
+ this.switch.addCommandHandler('on', async () => {
30
+ this.switch?.getClusterServer(OnOffCluster)?.setOnOffAttribute(true);
31
+ this.log.info('Command on called');
24
32
  });
33
+ this.switch.addCommandHandler('off', async () => {
34
+ this.switch?.getClusterServer(OnOffCluster)?.setOnOffAttribute(false);
35
+ this.log.info('Command off called');
36
+ });
37
+ // Create a light device
25
38
  this.light = new MatterbridgeDevice(DeviceTypes.ON_OFF_LIGHT);
26
39
  this.light.createDefaultIdentifyClusterServer();
27
40
  this.light.createDefaultGroupsClusterServer();
@@ -29,35 +42,151 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
29
42
  this.light.createDefaultBridgedDeviceBasicInformationClusterServer('Bridged device 2', '0x23480564', 0xfff1, 'Luligu', 'Dynamic device 2');
30
43
  this.light.createDefaultPowerSourceReplaceableBatteryClusterServer(70);
31
44
  this.light.createDefaultOnOffClusterServer();
45
+ this.light.createDefaultLevelControlClusterServer();
46
+ this.light.createDefaultColorControlClusterServer();
32
47
  await this.registerDevice(this.light);
33
48
  this.light.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
34
49
  this.log.info(`Command identify called identifyTime:${identifyTime}`);
35
50
  });
36
51
  this.light.addCommandHandler('on', async () => {
52
+ this.light?.getClusterServer(OnOffCluster)?.setOnOffAttribute(true);
37
53
  this.log.info('Command on called');
38
54
  });
39
55
  this.light.addCommandHandler('off', async () => {
56
+ this.light?.getClusterServer(OnOffCluster)?.setOnOffAttribute(false);
40
57
  this.log.info('Command off called');
41
58
  });
42
- }
43
- async onConfigure() {
44
- this.log.info('onConfigure called');
45
- if (!this.cover)
46
- return;
47
- const coverCluster = this.cover.getClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift));
48
- if (coverCluster && coverCluster.getCurrentPositionLiftPercent100thsAttribute) {
49
- const position = coverCluster.getCurrentPositionLiftPercent100thsAttribute();
50
- if (position === null)
51
- return;
52
- this.log.debug(`**onConfigure called. Current PositionLiftPercent100ths is ${position}. Set target and status.`);
53
- coverCluster.setTargetPositionLiftPercent100thsAttribute(position);
54
- coverCluster.setOperationalStatusAttribute({
59
+ this.light.addCommandHandler('moveToLevel', async ({ request: { level }, attributes: { currentLevel } }) => {
60
+ this.light?.getClusterServer(LevelControlCluster)?.setCurrentLevelAttribute(level);
61
+ this.log.debug(`Command moveToLevel called request: ${level} attributes: ${currentLevel?.getLocal()}`);
62
+ });
63
+ this.light.addCommandHandler('moveToLevelWithOnOff', async ({ request: { level }, attributes: { currentLevel } }) => {
64
+ this.light?.getClusterServer(LevelControlCluster)?.setCurrentLevelAttribute(level);
65
+ this.log.debug(`Command moveToLevelWithOnOff called request: ${level} attributes: ${currentLevel?.getLocal()}`);
66
+ });
67
+ this.light.addCommandHandler('moveToHueAndSaturation', async ({ request: { hue, saturation }, attributes: { currentHue, currentSaturation } }) => {
68
+ this.light?.getClusterServer(ColorControlCluster.with(ColorControl.Feature.HueSaturation))?.setCurrentHueAttribute(hue);
69
+ this.light?.getClusterServer(ColorControlCluster.with(ColorControl.Feature.HueSaturation))?.setCurrentSaturationAttribute(saturation);
70
+ this.log.debug(`Command moveToHueAndSaturation called request: hue ${hue} saturation ${saturation} attributes: hue ${currentHue?.getLocal()} saturation ${currentSaturation?.getLocal()}`);
71
+ });
72
+ this.light.addCommandHandler('moveToColorTemperature', async ({ request, attributes }) => {
73
+ this.light?.getClusterServer(ColorControl.Complete)?.setColorTemperatureMiredsAttribute(request.colorTemperatureMireds);
74
+ this.log.debug(`Command moveToColorTemperature called request: ${request.colorTemperatureMireds} attributes: ${attributes.colorTemperatureMireds?.getLocal()}`);
75
+ });
76
+ // Create an outlet device
77
+ this.outlet = new MatterbridgeDevice(DeviceTypes.ON_OFF_PLUGIN_UNIT);
78
+ this.outlet.createDefaultIdentifyClusterServer();
79
+ this.outlet.createDefaultGroupsClusterServer();
80
+ this.outlet.createDefaultScenesClusterServer();
81
+ this.outlet.createDefaultBridgedDeviceBasicInformationClusterServer('Bridged device 4', '0x29252164', 0xfff1, 'Luligu', 'Dynamic device 4');
82
+ this.outlet.createDefaultPowerSourceWiredClusterServer();
83
+ this.outlet.createDefaultOnOffClusterServer();
84
+ await this.registerDevice(this.outlet);
85
+ this.outlet.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
86
+ this.log.info(`Command identify called identifyTime:${identifyTime}`);
87
+ });
88
+ this.outlet.addCommandHandler('on', async () => {
89
+ this.outlet?.getClusterServer(OnOffCluster)?.setOnOffAttribute(true);
90
+ this.log.info('Command on called');
91
+ });
92
+ this.outlet.addCommandHandler('off', async () => {
93
+ this.outlet?.getClusterServer(OnOffCluster)?.setOnOffAttribute(false);
94
+ this.log.info('Command off called');
95
+ });
96
+ // Create a window covering device
97
+ this.cover = new MatterbridgeDevice(DeviceTypes.WINDOW_COVERING);
98
+ this.cover.createDefaultIdentifyClusterServer();
99
+ this.cover.createDefaultGroupsClusterServer();
100
+ this.cover.createDefaultScenesClusterServer();
101
+ this.cover.createDefaultBridgedDeviceBasicInformationClusterServer('Bridged device 1', '0x01020564', 0xfff1, 'Luligu', 'Dynamic device 1');
102
+ this.cover.createDefaultPowerSourceRechargeableBatteryClusterServer(86);
103
+ this.cover.createDefaultWindowCoveringClusterServer();
104
+ await this.registerDevice(this.cover);
105
+ this.cover.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
106
+ this.log.info(`Command identify called identifyTime:${identifyTime}`);
107
+ });
108
+ this.cover.addCommandHandler('stopMotion', async ({ attributes: { currentPositionLiftPercent100ths, targetPositionLiftPercent100ths, operationalStatus } }) => {
109
+ const position = currentPositionLiftPercent100ths?.getLocal();
110
+ if (position !== null && position !== undefined)
111
+ targetPositionLiftPercent100ths?.setLocal(position);
112
+ operationalStatus.setLocal({
55
113
  global: WindowCovering.MovementStatus.Stopped,
56
114
  lift: WindowCovering.MovementStatus.Stopped,
57
115
  tilt: WindowCovering.MovementStatus.Stopped,
58
116
  });
59
- }
60
- setInterval(() => {
117
+ this.log.debug(`Command stopMotion called. Attributes: currentPositionLiftPercent100ths: ${currentPositionLiftPercent100ths?.getLocal()}`);
118
+ this.log.debug(`Command stopMotion called. Attributes: targetPositionLiftPercent100ths: ${targetPositionLiftPercent100ths?.getLocal()}`);
119
+ this.log.debug(`Command stopMotion called. Attributes: operationalStatus: ${operationalStatus?.getLocal().lift}`);
120
+ });
121
+ this.cover.addCommandHandler('goToLiftPercentage', async ({ request: { liftPercent100thsValue }, attributes: { currentPositionLiftPercent100ths, targetPositionLiftPercent100ths, operationalStatus } }) => {
122
+ currentPositionLiftPercent100ths?.setLocal(liftPercent100thsValue);
123
+ targetPositionLiftPercent100ths?.setLocal(liftPercent100thsValue);
124
+ operationalStatus.setLocal({
125
+ global: WindowCovering.MovementStatus.Stopped,
126
+ lift: WindowCovering.MovementStatus.Stopped,
127
+ tilt: WindowCovering.MovementStatus.Stopped,
128
+ });
129
+ this.log.info(`Command goToLiftPercentage called. Request: liftPercent100thsValue: ${liftPercent100thsValue} `);
130
+ this.log.debug(`Command goToLiftPercentage called. Attributes: currentPositionLiftPercent100ths: ${currentPositionLiftPercent100ths?.getLocal()}`);
131
+ this.log.debug(`Command goToLiftPercentage called. Attributes: targetPositionLiftPercent100ths: ${targetPositionLiftPercent100ths?.getLocal()}`);
132
+ this.log.debug(`Command goToLiftPercentage called. Attributes: operationalStatus: ${operationalStatus?.getLocal().lift}`);
133
+ });
134
+ }
135
+ async onConfigure() {
136
+ this.log.info('onConfigure called');
137
+ // Set switch to off
138
+ this.switch?.getClusterServer(OnOffCluster)?.setOnOffAttribute(false);
139
+ this.log.info('Set switch initial onOff to false');
140
+ this.switchInterval = setInterval(() => {
141
+ if (!this.switch)
142
+ return;
143
+ const status = this.switch.getClusterServer(OnOffCluster)?.getOnOffAttribute();
144
+ this.switch.getClusterServer(OnOffCluster)?.setOnOffAttribute(!status);
145
+ this.log.info(`Set switch onOff to ${status}`);
146
+ }, 60 * 1000 + 100);
147
+ // Set light to off, level to 0 and hue to 0 and saturation to 50% (pink color)
148
+ this.light?.getClusterServer(OnOffCluster)?.setOnOffAttribute(false);
149
+ this.light?.getClusterServer(LevelControlCluster)?.setCurrentLevelAttribute(0);
150
+ this.light?.getClusterServer(ColorControlCluster.with(ColorControl.Feature.HueSaturation))?.setCurrentHueAttribute(0);
151
+ this.light?.getClusterServer(ColorControlCluster.with(ColorControl.Feature.HueSaturation))?.setCurrentSaturationAttribute(128);
152
+ this.log.info('Set light initial onOff to false, currentLevel to 0, hue to 0 and saturation to 50%.');
153
+ this.lightInterval = setInterval(() => {
154
+ if (!this.light)
155
+ return;
156
+ const lightLevelControlCluster = this.light.getClusterServer(LevelControlCluster);
157
+ if (lightLevelControlCluster) {
158
+ let level = lightLevelControlCluster.getCurrentLevelAttribute();
159
+ if (level === null)
160
+ return;
161
+ level += 10;
162
+ if (level > 254) {
163
+ level = 0;
164
+ this.light.getClusterServer(OnOffCluster)?.setOnOffAttribute(false);
165
+ this.log.info('Set light onOff to false');
166
+ return;
167
+ }
168
+ else {
169
+ this.light.getClusterServer(OnOffCluster)?.setOnOffAttribute(true);
170
+ this.log.info('Set light onOff to true');
171
+ }
172
+ lightLevelControlCluster.setCurrentLevelAttribute(level);
173
+ this.log.info(`Set light currentLevel to ${level}`);
174
+ }
175
+ }, 60 * 1000 + 200);
176
+ // Set outlet to off
177
+ this.outlet?.getClusterServer(OnOffCluster)?.setOnOffAttribute(false);
178
+ this.log.info('Set outlet initial onOff to false');
179
+ this.outletInterval = setInterval(() => {
180
+ if (!this.outlet)
181
+ return;
182
+ const status = this.outlet.getClusterServer(OnOffCluster)?.getOnOffAttribute();
183
+ this.outlet.getClusterServer(OnOffCluster)?.setOnOffAttribute(!status);
184
+ this.log.info(`Set outlet onOff to ${status}`);
185
+ }, 60 * 1000 + 300);
186
+ // Set cover to target = current position and status to stopped (current position is persisted in the cluster)
187
+ this.cover?.setWindowCoveringTargetAsCurrentAndStopped();
188
+ this.log.debug('Set cover initial targetPositionLiftPercent100ths = currentPositionLiftPercent100ths and operationalStatus to Stopped.');
189
+ this.coverInterval = setInterval(() => {
61
190
  if (!this.cover)
62
191
  return;
63
192
  const coverCluster = this.cover.getClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift));
@@ -73,22 +202,17 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
73
202
  lift: WindowCovering.MovementStatus.Stopped,
74
203
  tilt: WindowCovering.MovementStatus.Stopped,
75
204
  });
76
- this.log.info(`Set PositionLiftPercent100ths to ${position}`);
205
+ this.log.info(`Set cover positionLiftPercent100ths to ${position}`);
77
206
  }
78
- }, 60 * 1000 + 500);
79
- setInterval(() => {
80
- if (!this.light)
81
- return;
82
- const lightCluster = this.light.getClusterServer(OnOffCluster);
83
- if (lightCluster) {
84
- const status = lightCluster.getOnOffAttribute();
85
- lightCluster.setOnOffAttribute(!status);
86
- this.log.info(`Set onOff to ${!status}`);
87
- }
88
- }, 60 * 1000 + 200);
207
+ }, 60 * 1000 + 400);
89
208
  }
90
209
  async onShutdown(reason) {
91
210
  this.log.info('onShutdown called with reason:', reason ?? 'none');
211
+ clearInterval(this.switchInterval);
212
+ clearInterval(this.lightInterval);
213
+ clearInterval(this.outletInterval);
214
+ clearInterval(this.coverInterval);
215
+ await this.unregisterAllDevices();
92
216
  }
93
217
  }
94
218
  //# sourceMappingURL=platform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEhG,OAAO,EAAgB,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAG7F,MAA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AAI,QAAQ,KAAK,IAAI;oBAAE,OAAO;gBAC9B,QAAQ,GAAG,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;gBAClD,YAAY,CAAC,2CAA2C,CAAC,QAAQ,CAAC,CAAC;gBACnE,YAAY,CAAC,4CAA4C,CAAC,QAAQ,CAAC,CAAC;gBACpE,YAAY,CAAC,6BAA6B,CAAC;oBACzC,MAAM,EAAE,cAAc,CAAC,cAAc,CAAC,OAAO;oBAC7C,IAAI,EAAE,cAAc,CAAC,cAAc,CAAC,OAAO;oBAC3C,IAAI,EAAE,cAAc,CAAC,cAAc,CAAC,OAAO;iBAC5C,CAAC,CAAC;gBACH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,0CAA0C,QAAQ,EAAE,CAAC,CAAC;YACtE,CAAC;QACH,CAAC,EACD,EAAE,GAAG,IAAI,GAAG,GAAG,CAChB,CAAC;IACJ,CAAC;IAEQ,KAAK,CAAC,UAAU,CAAC,MAAe;QACvC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gCAAgC,EAAE,MAAM,IAAI,MAAM,CAAC,CAAC;QAClE,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAClC,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAClC,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACpC,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-example-dynamic-platform",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "description": "Matterbridge dynamic platform plugin example",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "types": "dist/index.d.js",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "https://github.com/Luligu/matterbridge-example-dynamic-platform"
12
+ "url": "git+https://github.com/Luligu/matterbridge-example-dynamic-platform.git"
13
13
  },
14
14
  "bugs": {
15
15
  "url": "https://github.com/Luligu/matterbridge-example-dynamic-platform/issues"
@@ -52,16 +52,16 @@
52
52
  "install": "node link-matterbridge-script.js && npm run build"
53
53
  },
54
54
  "devDependencies": {
55
- "@stylistic/eslint-plugin": "^1.6.3",
55
+ "@stylistic/eslint-plugin": "^1.7.0",
56
56
  "@tsconfig/node-lts": "^20.1.1",
57
- "@types/node": "^20.11.27",
58
- "@typescript-eslint/eslint-plugin": "^7.2.0",
59
- "@typescript-eslint/parser": "^7.2.0",
57
+ "@types/node": "^20.11.30",
58
+ "@typescript-eslint/eslint-plugin": "^7.3.1",
59
+ "@typescript-eslint/parser": "^7.3.1",
60
60
  "eslint-config-prettier": "^9.1.0",
61
61
  "eslint-plugin-prettier": "^5.1.3",
62
62
  "matterbridge": "file:../matterbridge",
63
63
  "prettier": "^3.2.5",
64
- "typescript": "^5.4.2"
64
+ "typescript": "^5.4.3"
65
65
  },
66
66
  "dependencies": {
67
67
  "node-ansi-logger": "^1.9.2"