matterbridge-zigbee2mqtt 2.4.4 → 2.4.5-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
@@ -4,6 +4,20 @@ If you like this project and find it useful, please consider giving it a star on
4
4
 
5
5
  All notable changes to this project will be documented in this file.
6
6
 
7
+ ## [2.4.5] - 2025-02-04
8
+
9
+ ### Changed
10
+
11
+ - [package]: Updated dependencies.
12
+
13
+ ### Fixed
14
+
15
+ - [endpoint]: Fix thermostat bug.
16
+
17
+ <a href="https://www.buymeacoffee.com/luligugithub">
18
+ <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
19
+ </a>
20
+
7
21
  ## [2.4.4] - 2025-02-02
8
22
 
9
23
  ### Changed
package/dist/entity.js CHANGED
@@ -5,12 +5,8 @@ import * as color from 'matterbridge/utils';
5
5
  import { SwitchesTag, NumberTag } from 'matterbridge/matter';
6
6
  import { getClusterNameById, ClusterId } from 'matterbridge/matter/types';
7
7
  import { ElectricalEnergyMeasurement, ElectricalPowerMeasurement, OnOffCluster, LevelControlCluster, WindowCoveringCluster, DoorLockCluster, BridgedDeviceBasicInformation, OnOff, LevelControl, ColorControl, ColorControlCluster, TemperatureMeasurement, BooleanState, RelativeHumidityMeasurement, PressureMeasurement, OccupancySensing, IlluminanceMeasurement, PowerSource, WindowCovering, DoorLock, ThermostatCluster, Thermostat, AirQuality, TotalVolatileOrganicCompoundsConcentrationMeasurement, CarbonDioxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurement, FormaldehydeConcentrationMeasurement, Pm1ConcentrationMeasurement, Pm25ConcentrationMeasurement, Pm10ConcentrationMeasurement, } from 'matterbridge/matter/clusters';
8
- import { PowerSourceBehavior } from 'matterbridge/matter/behaviors';
9
8
  import EventEmitter from 'events';
10
9
  import { hostname } from 'os';
11
- function require(type, options) {
12
- return { clusterId: ClusterId(1), options };
13
- }
14
10
  export class ZigbeeEntity extends EventEmitter {
15
11
  log;
16
12
  serial = '';
@@ -890,14 +886,32 @@ export class ZigbeeDevice extends ZigbeeEntity {
890
886
  zigbeeDevice.addBridgedDeviceBasicInformation();
891
887
  zigbeeDevice.addPowerSource();
892
888
  mainEndpoint.clusterServersIds.splice(mainEndpoint.clusterServersIds.indexOf(PowerSource.Cluster.id), 1);
893
- const options = require(PowerSourceBehavior.with(PowerSource.Feature.Wired), {
894
- wiredCurrentType: PowerSource.WiredCurrentType.Ac,
895
- description: 'AC Power',
896
- status: PowerSource.PowerSourceStatus.Active,
897
- order: 0,
898
- endpointList: [],
899
- });
900
- mainEndpoint.clusterServersOptions.push(options);
889
+ for (const [endpoint, device] of zigbeeDevice.mutableDevice) {
890
+ const deviceClusterServersIdMap = new Map();
891
+ device.clusterServersIds.forEach((clusterServer) => {
892
+ deviceClusterServersIdMap.set(clusterServer, clusterServer);
893
+ });
894
+ const deviceClusterServersObjMap = new Map();
895
+ device.clusterServersOptions.forEach((clusterServer) => {
896
+ deviceClusterServersIdMap.delete(clusterServer.clusterId);
897
+ deviceClusterServersObjMap.set(clusterServer.clusterId, clusterServer);
898
+ });
899
+ device.clusterServersIds = Array.from(deviceClusterServersIdMap.values());
900
+ device.clusterServersOptions = Array.from(deviceClusterServersObjMap.values());
901
+ const deviceClusterClientsIdMap = new Map();
902
+ device.clusterClientsIds.forEach((clusterClient) => {
903
+ deviceClusterClientsIdMap.set(clusterClient, clusterClient);
904
+ });
905
+ const deviceClusterClientsObjMap = new Map();
906
+ device.clusterClientsOptions.forEach((clusterClient) => {
907
+ deviceClusterClientsIdMap.delete(clusterClient.clusterId);
908
+ deviceClusterClientsObjMap.set(clusterClient.clusterId, clusterClient);
909
+ });
910
+ device.clusterClientsIds = Array.from(deviceClusterClientsIdMap.values());
911
+ device.clusterClientsOptions = Array.from(deviceClusterClientsObjMap.values());
912
+ zigbeeDevice.log.debug(`Device ${zigbeeDevice.ien}${zigbeeDevice.device?.friendly_name}${rs}${db} endpoint: ${ign}${endpoint === '' ? 'main' : endpoint}${rs}${db} => ` +
913
+ `${nf}tagList: ${debugStringify(device.tagList)} deviceTypes: ${debugStringify(device.deviceTypes)} clusterServersIds: ${debugStringify(device.clusterServersIds)}`);
914
+ }
901
915
  if (mainEndpoint.clusterServersIds.includes(ColorControl.Cluster.id)) {
902
916
  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')}`);
903
917
  if (!names.includes('color_hs') && !names.includes('color_xy')) {
@@ -929,32 +943,6 @@ export class ZigbeeDevice extends ZigbeeEntity {
929
943
  mainEndpoint.clusterServersIds.splice(mainEndpoint.clusterServersIds.indexOf(Thermostat.Cluster.id), 1);
930
944
  }
931
945
  }
932
- for (const [endpoint, device] of zigbeeDevice.mutableDevice) {
933
- const deviceClusterServersIdMap = new Map();
934
- device.clusterServersIds.forEach((clusterServer) => {
935
- deviceClusterServersIdMap.set(clusterServer, clusterServer);
936
- });
937
- const deviceClusterServersObjMap = new Map();
938
- device.clusterServersOptions.forEach((clusterServer) => {
939
- deviceClusterServersIdMap.delete(clusterServer.clusterId);
940
- deviceClusterServersObjMap.set(clusterServer.clusterId, clusterServer);
941
- });
942
- device.clusterServersIds = Array.from(deviceClusterServersIdMap.values());
943
- device.clusterServersOptions = Array.from(deviceClusterServersObjMap.values());
944
- const deviceClusterClientsIdMap = new Map();
945
- device.clusterClientsIds.forEach((clusterClient) => {
946
- deviceClusterClientsIdMap.set(clusterClient, clusterClient);
947
- });
948
- const deviceClusterClientsObjMap = new Map();
949
- device.clusterClientsOptions.forEach((clusterClient) => {
950
- deviceClusterClientsIdMap.delete(clusterClient.clusterId);
951
- deviceClusterClientsObjMap.set(clusterClient.clusterId, clusterClient);
952
- });
953
- device.clusterClientsIds = Array.from(deviceClusterClientsIdMap.values());
954
- device.clusterClientsOptions = Array.from(deviceClusterClientsObjMap.values());
955
- zigbeeDevice.log.debug(`Device ${zigbeeDevice.ien}${zigbeeDevice.device?.friendly_name}${rs}${db} endpoint: ${ign}${endpoint === '' ? 'main' : endpoint}${rs}${db} => ` +
956
- `${nf}tagList: ${debugStringify(device.tagList)} deviceTypes: ${debugStringify(device.deviceTypes)} clusterServersIds: ${debugStringify(device.clusterServersIds)}`);
957
- }
958
946
  zigbeeDevice.bridgedDevice.addClusterServers(mainEndpoint.clusterServersIds);
959
947
  zigbeeDevice.bridgedDevice.addRequiredClusterServers();
960
948
  if (zigbeeDevice.composedType !== '')
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "2.4.4",
3
+ "version": "2.4.5-dev.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-zigbee2mqtt",
9
- "version": "2.4.4",
9
+ "version": "2.4.5-dev.1",
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.13.0",
39
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.0.tgz",
40
- "integrity": "sha512-ClIbNe36lawluuvq3+YYhnIN2CELi+6q8NpnM7PYp4hBn/TatfboPgVSm2rwKRfnV2M+Ty9GWDFI64KEe+kysA==",
38
+ "version": "22.13.1",
39
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.1.tgz",
40
+ "integrity": "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==",
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.4.4",
3
+ "version": "2.4.5-dev.1",
4
4
  "description": "Matterbridge zigbee2mqtt plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",