matterbridge-zigbee2mqtt 2.3.1-dev.1 → 2.3.1-dev.2

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/dist/entity.js CHANGED
@@ -443,7 +443,7 @@ export class ZigbeeGroup extends ZigbeeEntity {
443
443
  return zigbeeGroup;
444
444
  zigbeeGroup.logPropertyMap();
445
445
  if (isSwitch || isLight) {
446
- if (isSwitch)
446
+ if (isSwitch && !isLight)
447
447
  await zigbeeGroup.bridgedDevice.addFixedLabel('type', 'switch');
448
448
  if (isLight)
449
449
  await zigbeeGroup.bridgedDevice.addFixedLabel('type', 'light');
@@ -898,7 +898,9 @@ export class ZigbeeDevice extends ZigbeeEntity {
898
898
  mainEndpoint.clusterServersObjs.push(zigbeeDevice.getPowerSource());
899
899
  if (mainEndpoint.clusterServersIds.includes(ColorControl.Cluster.id)) {
900
900
  zigbeeDevice.log.debug(`Configuring device ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} ColorControlCluster cluster with HS: ${names.includes('color_hs')} XY: ${names.includes('color_xy')} CT: ${names.includes('color_temp')}`);
901
- zigbeeDevice.bridgedDevice.configureColorControlCluster(names.includes('color_hs') || names.includes('color_xy'), false, names.includes('color_temp'));
901
+ if (!names.includes('color_hs') && !names.includes('color_xy')) {
902
+ mainEndpoint.clusterServersObjs.push(zigbeeDevice.bridgedDevice.getCtColorControlClusterServer());
903
+ }
902
904
  }
903
905
  if (mainEndpoint.clusterServersIds.includes(Thermostat.Cluster.id)) {
904
906
  const heat = zigbeeDevice.propertyMap.get('occupied_heating_setpoint') || zigbeeDevice.propertyMap.get('current_heating_setpoint');
@@ -1070,7 +1072,7 @@ export class ZigbeeDevice extends ZigbeeEntity {
1070
1072
  });
1071
1073
  }
1072
1074
  if (zigbeeDevice.bridgedDevice.getClusterServerById(ColorControlCluster.id) && zigbeeDevice.bridgedDevice.getClusterServer(ColorControlCluster)?.isAttributeSupportedByName('colorTemperatureMireds')) {
1073
- zigbeeDevice.bridgedDevice.addCommandHandler('moveToColorTemperature', async ({ request: request }) => {
1075
+ zigbeeDevice.bridgedDevice.addCommandHandler('moveToColorTemperature', async ({ request }) => {
1074
1076
  zigbeeDevice.log.debug(`Command moveToColorTemperature called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} request: ${request.colorTemperatureMireds}`);
1075
1077
  await zigbeeDevice.bridgedDevice?.setAttribute(ColorControlCluster.id, 'colorMode', ColorControl.ColorMode.ColorTemperatureMireds, zigbeeDevice.log);
1076
1078
  const payload = { color_temp: request.colorTemperatureMireds };
@@ -1079,10 +1081,20 @@ export class ZigbeeDevice extends ZigbeeEntity {
1079
1081
  zigbeeDevice.publishCommand('moveToColorTemperature', device.friendly_name, payload);
1080
1082
  });
1081
1083
  }
1084
+ if (zigbeeDevice.bridgedDevice.getClusterServerById(ColorControlCluster.id) && zigbeeDevice.bridgedDevice.getClusterServer(ColorControlCluster)?.isAttributeSupportedByName('currentX')) {
1085
+ zigbeeDevice.bridgedDevice.addCommandHandler('moveToColor', async ({ request }) => {
1086
+ zigbeeDevice.log.debug(`Command moveToColor called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} request: X: ${request.colorX} Y: ${request.colorY}`);
1087
+ await zigbeeDevice.bridgedDevice?.setAttribute(ColorControlCluster.id, 'colorMode', ColorControl.ColorMode.CurrentXAndCurrentY, zigbeeDevice.log);
1088
+ const payload = { color: { x: request.colorX / 65536, y: request.colorY / 65536 } };
1089
+ if (zigbeeDevice.transition && request.transitionTime && request.transitionTime / 10 >= 1)
1090
+ payload['transition'] = Math.round(request.transitionTime / 10);
1091
+ zigbeeDevice.publishCommand('moveToColor', device.friendly_name, payload);
1092
+ });
1093
+ }
1082
1094
  if (zigbeeDevice.bridgedDevice.getClusterServerById(ColorControlCluster.id) && zigbeeDevice.bridgedDevice.getClusterServer(ColorControlCluster)?.isAttributeSupportedByName('currentHue')) {
1083
1095
  let lastRequestedHue = 0;
1084
1096
  let lastRequestedSaturation = 0;
1085
- zigbeeDevice.bridgedDevice.addCommandHandler('moveToHue', async ({ request: request }) => {
1097
+ zigbeeDevice.bridgedDevice.addCommandHandler('moveToHue', async ({ request }) => {
1086
1098
  zigbeeDevice.log.debug(`Command moveToHue called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} request: ${request.hue}`);
1087
1099
  await zigbeeDevice.bridgedDevice?.setAttribute(ColorControlCluster.id, 'colorMode', ColorControl.ColorMode.CurrentHueAndCurrentSaturation, zigbeeDevice.log);
1088
1100
  lastRequestedHue = request.hue;
@@ -1095,7 +1107,7 @@ export class ZigbeeDevice extends ZigbeeEntity {
1095
1107
  zigbeeDevice.publishCommand('moveToHue', device.friendly_name, payload);
1096
1108
  }, 500);
1097
1109
  });
1098
- zigbeeDevice.bridgedDevice.addCommandHandler('moveToSaturation', async ({ request: request }) => {
1110
+ zigbeeDevice.bridgedDevice.addCommandHandler('moveToSaturation', async ({ request }) => {
1099
1111
  zigbeeDevice.log.debug(`Command moveToSaturation called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} request: ${request.saturation}`);
1100
1112
  await zigbeeDevice.bridgedDevice?.setAttribute(ColorControlCluster.id, 'colorMode', ColorControl.ColorMode.CurrentHueAndCurrentSaturation, zigbeeDevice.log);
1101
1113
  lastRequestedSaturation = request.saturation;
@@ -1108,7 +1120,7 @@ export class ZigbeeDevice extends ZigbeeEntity {
1108
1120
  zigbeeDevice.publishCommand('moveToSaturation', device.friendly_name, payload);
1109
1121
  }, 500);
1110
1122
  });
1111
- zigbeeDevice.bridgedDevice.addCommandHandler('moveToHueAndSaturation', async ({ request: request }) => {
1123
+ zigbeeDevice.bridgedDevice.addCommandHandler('moveToHueAndSaturation', async ({ request }) => {
1112
1124
  zigbeeDevice.log.debug(`Command moveToHueAndSaturation called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} request: ${request.hue}-${request.saturation}`);
1113
1125
  await zigbeeDevice.bridgedDevice?.setAttribute(ColorControlCluster.id, 'colorMode', ColorControl.ColorMode.CurrentHueAndCurrentSaturation, zigbeeDevice.log);
1114
1126
  const rgb = color.hslColorToRgbColor((request.hue / 254) * 360, (request.saturation / 254) * 100, 50);
package/dist/platform.js CHANGED
@@ -38,8 +38,8 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
38
38
  availabilityTimer;
39
39
  constructor(matterbridge, log, config) {
40
40
  super(matterbridge, log, config);
41
- if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('1.6.5')) {
42
- throw new Error(`This plugin requires Matterbridge version >= "1.6.5". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend."`);
41
+ if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('1.6.6')) {
42
+ 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."`);
43
43
  }
44
44
  this.debugEnabled = config.debug;
45
45
  this.shouldStart = false;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "2.3.1-dev.1",
3
+ "version": "2.3.1-dev.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-zigbee2mqtt",
9
- "version": "2.3.1-dev.1",
9
+ "version": "2.3.1-dev.2",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "moment": "2.30.1",
@@ -35,9 +35,9 @@
35
35
  }
36
36
  },
37
37
  "node_modules/@types/node": {
38
- "version": "22.10.1",
39
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz",
40
- "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==",
38
+ "version": "22.10.2",
39
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz",
40
+ "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==",
41
41
  "license": "MIT",
42
42
  "dependencies": {
43
43
  "undici-types": "~6.20.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "2.3.1-dev.1",
3
+ "version": "2.3.1-dev.2",
4
4
  "description": "Matterbridge zigbee2mqtt plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",