matterbridge-zigbee2mqtt 2.4.5-dev.2 → 2.4.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
@@ -12,7 +12,7 @@ All notable changes to this project will be documented in this file.
12
12
 
13
13
  ### Fixed
14
14
 
15
- - [endpoint]: Fix thermostat bug.
15
+ - [endpoint]: Fix thermostat bug (thanks https://github.com/robvanoostenrijk).
16
16
 
17
17
  <a href="https://www.buymeacoffee.com/luligugithub">
18
18
  <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
package/dist/entity.js CHANGED
@@ -179,12 +179,18 @@ export class ZigbeeEntity extends EventEmitter {
179
179
  });
180
180
  }
181
181
  destroy() {
182
+ this.removeAllListeners();
182
183
  if (this.colorTimeout)
183
184
  clearTimeout(this.colorTimeout);
184
185
  this.colorTimeout = undefined;
185
186
  if (this.thermostatTimeout)
186
187
  clearTimeout(this.thermostatTimeout);
187
188
  this.thermostatTimeout = undefined;
189
+ this.device = undefined;
190
+ this.group = undefined;
191
+ this.bridgedDevice = undefined;
192
+ this.mutableDevice.clear();
193
+ this.propertyMap.clear();
188
194
  }
189
195
  addBridgedDeviceBasicInformation() {
190
196
  if (!this.bridgedDevice)
@@ -437,6 +443,7 @@ export class ZigbeeGroup extends ZigbeeEntity {
437
443
  zigbeeGroup.bridgedDevice.addRequiredClusterServers();
438
444
  if (!zigbeeGroup.bridgedDevice || !zigbeeGroup.verifyMutableDevice(zigbeeGroup.bridgedDevice))
439
445
  return zigbeeGroup;
446
+ zigbeeGroup.mutableDevice.clear();
440
447
  zigbeeGroup.logPropertyMap();
441
448
  if (isSwitch || isLight) {
442
449
  if (isSwitch && !isLight)
@@ -565,7 +572,7 @@ export class ZigbeeGroup extends ZigbeeEntity {
565
572
  zigbeeGroup.bridgedDevice.subscribeAttribute(ThermostatCluster.id, 'occupiedCoolingSetpoint', (newValue, oldValue) => {
566
573
  zigbeeGroup.bridgedDevice?.log.info(`Thermostat occupiedCoolingSetpoint changed from ${oldValue / 100} to ${newValue / 100}`);
567
574
  zigbeeGroup.bridgedDevice?.log.info(`Setting thermostat occupiedCoolingSetpoint to ${newValue / 100}`);
568
- zigbeeGroup.publishCommand('CurrentCoolingSetpoint', group.friendly_name, { current_cooling_setpoint: Math.round(newValue / 100) });
575
+ zigbeeGroup.publishCommand('CurrentCoolingSetpoint', group.friendly_name, { current_heating_setpoint: Math.round(newValue / 100) });
569
576
  zigbeeGroup.publishCommand('OccupiedCoolingSetpoint', group.friendly_name, { occupied_cooling_setpoint: Math.round(newValue / 100) });
570
577
  zigbeeGroup.noUpdate = true;
571
578
  zigbeeGroup.thermostatTimeout = setTimeout(() => {
@@ -1179,11 +1186,9 @@ export class ZigbeeDevice extends ZigbeeEntity {
1179
1186
  const setpoint = Math.round(t / 100 + request.amount / 10);
1180
1187
  if (zigbeeDevice.propertyMap.has('current_heating_setpoint')) {
1181
1188
  zigbeeDevice.publishCommand('OccupiedHeatingSetpoint', device.friendly_name, { current_heating_setpoint: setpoint });
1182
- zigbeeDevice.log.debug('Command setpointRaiseLower sent:', debugStringify({ current_heating_setpoint: setpoint }));
1183
1189
  }
1184
1190
  else if (zigbeeDevice.propertyMap.has('occupied_heating_setpoint')) {
1185
1191
  zigbeeDevice.publishCommand('OccupiedHeatingSetpoint', device.friendly_name, { occupied_heating_setpoint: setpoint });
1186
- zigbeeDevice.log.debug('Command setpointRaiseLower sent:', debugStringify({ occupied_heating_setpoint: setpoint }));
1187
1192
  }
1188
1193
  }
1189
1194
  if (request.mode === Thermostat.SetpointRaiseLowerMode.Cool || request.mode === Thermostat.SetpointRaiseLowerMode.Both) {
@@ -1191,11 +1196,9 @@ export class ZigbeeDevice extends ZigbeeEntity {
1191
1196
  const setpoint = Math.round(t / 100 + request.amount / 10);
1192
1197
  if (zigbeeDevice.propertyMap.has('current_heating_setpoint')) {
1193
1198
  zigbeeDevice.publishCommand('OccupiedCoolingSetpoint', device.friendly_name, { current_heating_setpoint: setpoint });
1194
- zigbeeDevice.log.debug('Command setpointRaiseLower sent:', debugStringify({ current_heating_setpoint: setpoint }));
1195
1199
  }
1196
1200
  else if (zigbeeDevice.propertyMap.has('occupied_cooling_setpoint')) {
1197
1201
  zigbeeDevice.publishCommand('OccupiedCoolingSetpoint', device.friendly_name, { occupied_cooling_setpoint: setpoint });
1198
- zigbeeDevice.log.debug('Command setpointRaiseLower sent:', debugStringify({ occupied_cooling_setpoint: setpoint }));
1199
1202
  }
1200
1203
  }
1201
1204
  });
package/dist/platform.js CHANGED
@@ -223,7 +223,7 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
223
223
  this.z2m.on('device_interview', async (friendly_name, ieee_address, status, supported) => {
224
224
  this.log.info(`zigbee2MQTT sent device_interview device: ${friendly_name} ieee_address: ${ieee_address} status: ${status} supported: ${supported}`);
225
225
  if (status === 'successful' && supported) {
226
- if (!this.validateDeviceWhiteBlackList(friendly_name))
226
+ if (!this.validateDevice(friendly_name))
227
227
  return;
228
228
  this.log.info(`Registering device: ${friendly_name}`);
229
229
  const bridgedDevice = this.z2mBridgeDevices?.find((device) => device.friendly_name === friendly_name);
@@ -243,7 +243,7 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
243
243
  });
244
244
  this.z2m.on('group_add', async (friendly_name, id, status) => {
245
245
  this.log.info(`zigbee2MQTT sent group_add friendly_name: ${friendly_name} id ${id} status ${status}`);
246
- if (!this.validateDeviceWhiteBlackList(friendly_name))
246
+ if (!this.validateDevice(friendly_name))
247
247
  return;
248
248
  this.log.info(`Registering group: ${friendly_name}`);
249
249
  const bridgedGroup = this.z2mBridgeGroups?.find((group) => group.friendly_name === friendly_name);
@@ -479,6 +479,7 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
479
479
  if (entity) {
480
480
  this.log.info(`Removing device: ${friendly_name}`);
481
481
  await this.unregisterDevice(entity.bridgedDevice);
482
+ entity.destroy();
482
483
  this.zigbeeEntities = this.zigbeeEntities.filter((entity) => entity.entityName !== friendly_name);
483
484
  this.bridgedDevices = this.bridgedDevices.filter((device) => device.deviceName !== friendly_name);
484
485
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "2.4.5-dev.2",
3
+ "version": "2.4.5-dev.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-zigbee2mqtt",
9
- "version": "2.4.5-dev.2",
9
+ "version": "2.4.5-dev.3",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "moment": "2.30.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "2.4.5-dev.2",
3
+ "version": "2.4.5-dev.3",
4
4
  "description": "Matterbridge zigbee2mqtt plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",