matterbridge 2.1.4-dev.1 → 2.1.4-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 +3 -1
- package/dist/matterbridge.js +3 -0
- package/dist/matterbridgeEndpoint.js +4 -1
- package/dist/matterbridgePlatform.js +13 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -31,11 +31,13 @@ matterbridge-zigbee2mqtt v. 2.4.4
|
|
|
31
31
|
matterbridge-somfy-tahoma v. 1.2.3
|
|
32
32
|
matterbridge-hass v. 0.0.8
|
|
33
33
|
|
|
34
|
-
## [2.1.4] - 2025-02-
|
|
34
|
+
## [2.1.4] - 2025-02-06
|
|
35
35
|
|
|
36
36
|
### Added
|
|
37
37
|
|
|
38
38
|
- [frontend]: Added memorycheck before cleanup.
|
|
39
|
+
- [platform]: Added a check for not latin characters.
|
|
40
|
+
- [platform]: Added a check for already registered device names.
|
|
39
41
|
|
|
40
42
|
### Changed
|
|
41
43
|
|
package/dist/matterbridge.js
CHANGED
|
@@ -1078,6 +1078,9 @@ export class Matterbridge extends EventEmitter {
|
|
|
1078
1078
|
this.hasCleanupStarted = false;
|
|
1079
1079
|
this.initialized = false;
|
|
1080
1080
|
}
|
|
1081
|
+
else {
|
|
1082
|
+
this.log.debug('Cleanup already started...');
|
|
1083
|
+
}
|
|
1081
1084
|
}
|
|
1082
1085
|
async createAccessoryPlugin(plugin, device, start = false) {
|
|
1083
1086
|
if (!plugin.locked && device.deviceName && device.vendorId && device.productId && device.vendorName && device.productName) {
|
|
@@ -2,7 +2,7 @@ import { AnsiLogger, BLUE, CYAN, YELLOW, db, debugStringify, er, hk, or, zb } fr
|
|
|
2
2
|
import { bridgedNode } from './matterbridgeDeviceTypes.js';
|
|
3
3
|
import { isValidNumber, isValidObject } from './utils/utils.js';
|
|
4
4
|
import { MatterbridgeBehavior, MatterbridgeBehaviorDevice, MatterbridgeIdentifyServer, MatterbridgeOnOffServer, MatterbridgeLevelControlServer, MatterbridgeColorControlServer, MatterbridgeWindowCoveringServer, MatterbridgeThermostatServer, MatterbridgeFanControlServer, MatterbridgeDoorLockServer, MatterbridgeModeSelectServer, MatterbridgeValveConfigurationAndControlServer, MatterbridgeSmokeCoAlarmServer, MatterbridgeBooleanStateConfigurationServer, MatterbridgeSwitchServer, } from './matterbridgeBehaviors.js';
|
|
5
|
-
import { addClusterServers, addFixedLabel, addOptionalClusterServers, addRequiredClusterServers, addUserLabel, capitalizeFirstLetter, createUniqueId, getBehavior, getBehaviourTypesFromClusterClientIds, getBehaviourTypesFromClusterServerIds, getDefaultFlowMeasurementClusterServer, getDefaultIlluminanceMeasurementClusterServer, getDefaultPressureMeasurementClusterServer, getDefaultRelativeHumidityMeasurementClusterServer, getDefaultTemperatureMeasurementClusterServer, getDefaultOccupancySensingClusterServer, lowercaseFirstLetter, updateAttribute, getClusterId, getAttributeId, setAttribute, getAttribute, } from './matterbridgeEndpointHelpers.js';
|
|
5
|
+
import { addClusterServers, addFixedLabel, addOptionalClusterServers, addRequiredClusterServers, addUserLabel, capitalizeFirstLetter, createUniqueId, getBehavior, getBehaviourTypesFromClusterClientIds, getBehaviourTypesFromClusterServerIds, getDefaultFlowMeasurementClusterServer, getDefaultIlluminanceMeasurementClusterServer, getDefaultPressureMeasurementClusterServer, getDefaultRelativeHumidityMeasurementClusterServer, getDefaultTemperatureMeasurementClusterServer, getDefaultOccupancySensingClusterServer, lowercaseFirstLetter, updateAttribute, getClusterId, getAttributeId, setAttribute, getAttribute, checkNotLatinCharacters, generateUniqueId, } from './matterbridgeEndpointHelpers.js';
|
|
6
6
|
import { Endpoint, Lifecycle, MutableEndpoint, NamedHandler, SupportedBehaviors, VendorId } from '@matter/main';
|
|
7
7
|
import { getClusterNameById, MeasurementType } from '@matter/main/types';
|
|
8
8
|
import { Descriptor } from '@matter/main/clusters/descriptor';
|
|
@@ -110,6 +110,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
110
110
|
behaviors: options.tagList ? SupportedBehaviors(DescriptorServer.with(Descriptor.Feature.TagList)) : {},
|
|
111
111
|
};
|
|
112
112
|
const endpointV8 = MutableEndpoint(deviceTypeDefinitionV8);
|
|
113
|
+
if (options.uniqueStorageKey && checkNotLatinCharacters(options.uniqueStorageKey)) {
|
|
114
|
+
options.uniqueStorageKey = generateUniqueId(options.uniqueStorageKey);
|
|
115
|
+
}
|
|
113
116
|
const optionsV8 = {
|
|
114
117
|
id: options.uniqueStorageKey?.replace(/[ .]/g, ''),
|
|
115
118
|
number: options.endpointId,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { checkNotLatinCharacters } from './matterbridgeEndpointHelpers.js';
|
|
1
2
|
import { isValidArray, isValidObject, isValidString } from './utils/utils.js';
|
|
2
3
|
import { CYAN, db, er, nf, wr } from './logger/export.js';
|
|
3
4
|
import { NodeStorageManager } from './storage/export.js';
|
|
4
5
|
import path from 'path';
|
|
5
|
-
import { checkNotLatinCharacters } from './matterbridgeEndpointHelpers.js';
|
|
6
6
|
export class MatterbridgePlatform {
|
|
7
7
|
matterbridge;
|
|
8
8
|
log;
|
|
@@ -42,10 +42,21 @@ export class MatterbridgePlatform {
|
|
|
42
42
|
async onShutdown(reason) {
|
|
43
43
|
this.log.debug(`Shutting down platform ${this.name}`, reason);
|
|
44
44
|
await this.checkEndpointNumbers();
|
|
45
|
+
this.selectDevice.clear();
|
|
46
|
+
this.selectEntity.clear();
|
|
47
|
+
this.registeredEndpoints.clear();
|
|
48
|
+
this.registeredEndpointsByName.clear();
|
|
49
|
+
await this.context?.close();
|
|
50
|
+
this.context = undefined;
|
|
51
|
+
await this.storage?.close();
|
|
52
|
+
this.storage = undefined;
|
|
45
53
|
}
|
|
46
54
|
async onChangeLoggerLevel(logLevel) {
|
|
47
55
|
this.log.debug(`The plugin doesn't override onChangeLoggerLevel. Logger level set to: ${logLevel}`);
|
|
48
56
|
}
|
|
57
|
+
hasDeviceName(deviceName) {
|
|
58
|
+
return this.registeredEndpointsByName.has(deviceName);
|
|
59
|
+
}
|
|
49
60
|
async registerDevice(device) {
|
|
50
61
|
device.plugin = this.name;
|
|
51
62
|
if (device.deviceName && this.registeredEndpointsByName.has(device.deviceName)) {
|
|
@@ -53,8 +64,7 @@ export class MatterbridgePlatform {
|
|
|
53
64
|
return;
|
|
54
65
|
}
|
|
55
66
|
if (device.deviceName && checkNotLatinCharacters(device.deviceName)) {
|
|
56
|
-
this.log.debug(`Device with name ${CYAN}${device.deviceName}${
|
|
57
|
-
return;
|
|
67
|
+
this.log.debug(`Device with name ${CYAN}${device.deviceName}${db} has non latin characters. Please keep the name as short as possible.`);
|
|
58
68
|
}
|
|
59
69
|
await this.matterbridge.addBridgedEndpoint(this.name, device);
|
|
60
70
|
if (device.uniqueId)
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "2.1.4-dev.
|
|
3
|
+
"version": "2.1.4-dev.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge",
|
|
9
|
-
"version": "2.1.4-dev.
|
|
9
|
+
"version": "2.1.4-dev.3",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@matter/main": "0.12.3",
|