From 0be7dd6e2937839cef8327c309924eabfa618bf7 Mon Sep 17 00:00:00 2001 From: Ingo Fischer Date: Fri, 6 Dec 2024 11:15:24 +0100 Subject: [PATCH] Fixes and enhancements 06.12 (#200) * again package-lock * Fix noCompose in UI * null is allowed * use correct update methods for update * add convenience methods * DM fixes * Deszroy all matter event listeners on device destroy The _a/_b are needed till next matter,js update and can then be removed * Declare reachable state to be able to change it * Fixes object change handling * Allow Bridges to expose its name * README.md * matter.js update * typing change * Optimize object queue again * Fixes renaming of nodes and devices * Fix object processing vs unload * Fix debugging change --- README.md | 9 ++ package-lock.json | 118 +++++++++--------- package.json | 8 +- src-admin/package-lock.json | 4 +- src-admin/src/Tabs/Bridges.tsx | 27 +++- src-admin/src/Tabs/Devices.tsx | 5 +- src-admin/src/types.d.ts | 1 + src/lib/DeviceManagement.ts | 22 ++-- src/lib/devices/DeviceStateObject.ts | 2 +- src/lib/devices/ElectricityDataDevice.ts | 10 +- src/lib/devices/GenericDevice.ts | 31 +++++ src/main.ts | 71 +++++++---- src/matter/DeviceNode.ts | 1 + src/matter/GeneralMatterNode.ts | 4 +- src/matter/to-matter/CtToMatter.ts | 2 +- src/matter/to-matter/DimmerToMatter.ts | 2 +- src/matter/to-matter/GenericDeviceToMatter.ts | 9 +- .../GenericElectricityDataDeviceToMatter.ts | 10 +- src/matter/to-matter/LightToMatter.ts | 2 +- src/matter/to-matter/SocketToMatter.ts | 2 +- 20 files changed, 224 insertions(+), 116 deletions(-) diff --git a/README.md b/README.md index 1628f107..c733c4c9 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,15 @@ TBD --> ## Changelog + +### __WORK IN PROGRESS__ +* (@Apollon77) Sets the "no-compose" flag correctly to normally use composed if needed and adds it to a missing dialog +* (@Apollon77) Allows to use null values if needed +* (@Apollon77) Fixes UNREACH handling for devices +* (@Apollon77) Fixes object change handling for controller +* (@Apollon77) Allow Bridges to expose its name as a device name +* (@Apollon77) Allows to rename controller nodes and devices + ### 0.2.4 (2024-12-04) * (@Apollon77) Shows a progress indicator when deleting controller nodes * (@Apollon77) Cuts names and labels to 32 or 64 characters as needed by Matter diff --git a/package-lock.json b/package-lock.json index 729ab4f1..2e2bb6bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,9 +13,9 @@ "@iobroker/dm-utils": "^0.6.9", "@iobroker/i18n": "^0.3.1", "@iobroker/type-detector": "^4.0.1", - "@matter/main": "0.11.8", - "@matter/nodejs": "0.11.8", - "@project-chip/matter.js": "0.11.8", + "@matter/main": "0.11.9-alpha.0-20241206-22f233334", + "@matter/nodejs": "0.11.9-alpha.0-20241206-22f233334", + "@project-chip/matter.js": "0.11.9-alpha.0-20241206-22f233334", "axios": "^1.7.8", "jsonwebtoken": "^9.0.2" }, @@ -40,7 +40,7 @@ "node": ">=18" }, "optionalDependencies": { - "@matter/nodejs-ble": "0.11.8" + "@matter/nodejs-ble": "0.11.9-alpha.0-20241206-22f233334" } }, "node_modules/@alcalzone/pak": { @@ -747,64 +747,64 @@ } }, "node_modules/@matter/general": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@matter/general/-/general-0.11.8.tgz", - "integrity": "sha512-DBfa8A//DNVIpPWJzxQuE81svMTwxwKKNlODEhbJSXohXG8FaYwal2tcUQJCJwVb8eyWybOgKA30oX8qhpbHZw==", + "version": "0.11.9-alpha.0-20241206-22f233334", + "resolved": "https://registry.npmjs.org/@matter/general/-/general-0.11.9-alpha.0-20241206-22f233334.tgz", + "integrity": "sha512-NaQv/uL51G/7vTvcP2iexedpr46giMCcTOqg1HsnEySuspYmkirjGnEKOljv2UuP42inyU9JJuigWvjRyOK6UA==", "license": "Apache-2.0", "dependencies": { "@noble/curves": "^1.7.0" } }, "node_modules/@matter/main": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@matter/main/-/main-0.11.8.tgz", - "integrity": "sha512-6se6hK21KzpltK0BgV3wtsKVeGaT0H9VEkQZQ51InVx7O0EQjib0PoqNorFgdubGTISJnkcR/s/0vYw4PdiDxg==", + "version": "0.11.9-alpha.0-20241206-22f233334", + "resolved": "https://registry.npmjs.org/@matter/main/-/main-0.11.9-alpha.0-20241206-22f233334.tgz", + "integrity": "sha512-foOStFY7bi90ET2G8mTwXAxjuLQfyUXKs7PUV1B1O8IDz18N0ksj/9c3BSf5oq7ymWtVaEAWLi5AWu4wvAxciw==", "license": "Apache-2.0", "dependencies": { - "@matter/general": "0.11.8", - "@matter/model": "0.11.8", - "@matter/node": "0.11.8", - "@matter/protocol": "0.11.8", - "@matter/types": "0.11.8", + "@matter/general": "0.11.9-alpha.0-20241206-22f233334", + "@matter/model": "0.11.9-alpha.0-20241206-22f233334", + "@matter/node": "0.11.9-alpha.0-20241206-22f233334", + "@matter/protocol": "0.11.9-alpha.0-20241206-22f233334", + "@matter/types": "0.11.9-alpha.0-20241206-22f233334", "@noble/curves": "^1.7.0" }, "optionalDependencies": { - "@matter/nodejs": "0.11.8" + "@matter/nodejs": "0.11.9-alpha.0-20241206-22f233334" } }, "node_modules/@matter/model": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@matter/model/-/model-0.11.8.tgz", - "integrity": "sha512-EPZ8DEiVXYN4VJ3ylHj1hJVwlBJQk2QuePOfXxA2KaM1GSXUKiHW4TeyI+Jez7BzCfuWdyymCufA5grQn6pmEA==", + "version": "0.11.9-alpha.0-20241206-22f233334", + "resolved": "https://registry.npmjs.org/@matter/model/-/model-0.11.9-alpha.0-20241206-22f233334.tgz", + "integrity": "sha512-3FLQ3KG5j4+I6omso9MlIxSYSBrYUHN2DQ2a1m6snlAJi8kSVKRw3/u2scdBjIpqfoglrEtO05onm+qn0QP7Dw==", "license": "Apache-2.0", "dependencies": { - "@matter/general": "0.11.8", + "@matter/general": "0.11.9-alpha.0-20241206-22f233334", "@noble/curves": "^1.7.0" } }, "node_modules/@matter/node": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@matter/node/-/node-0.11.8.tgz", - "integrity": "sha512-TqcsQGlclFcXw5MpnhF4xFSp6B90IDpDDafYRlO+/Zoe4HojdLnRWHyA3OJfoQy7+HXSDVy2aqVi591KotZHng==", + "version": "0.11.9-alpha.0-20241206-22f233334", + "resolved": "https://registry.npmjs.org/@matter/node/-/node-0.11.9-alpha.0-20241206-22f233334.tgz", + "integrity": "sha512-RLd+sq74UK/Wy+BTIgpLHnCIFa7cROkLNhXst0ayu/tYAQmW7t77BFjGvTI3yFGZurzjWJvsI7gu9KR+dhGWSA==", "license": "Apache-2.0", "dependencies": { - "@matter/general": "0.11.8", - "@matter/model": "0.11.8", - "@matter/protocol": "0.11.8", - "@matter/types": "0.11.8", + "@matter/general": "0.11.9-alpha.0-20241206-22f233334", + "@matter/model": "0.11.9-alpha.0-20241206-22f233334", + "@matter/protocol": "0.11.9-alpha.0-20241206-22f233334", + "@matter/types": "0.11.9-alpha.0-20241206-22f233334", "@noble/curves": "^1.7.0" } }, "node_modules/@matter/nodejs": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@matter/nodejs/-/nodejs-0.11.8.tgz", - "integrity": "sha512-4DuO+qnnGCrh0ppt+FkY4HN351ehuFmnrWcD7GNVvog+aNJozjbZm2KrugJczUnd8VEISDFJtUmbQWmx5vVXeA==", + "version": "0.11.9-alpha.0-20241206-22f233334", + "resolved": "https://registry.npmjs.org/@matter/nodejs/-/nodejs-0.11.9-alpha.0-20241206-22f233334.tgz", + "integrity": "sha512-MQw/CvIK3Ozi/PKndc+ENBbX5x7GjwnzyZgTp1PAYWsaZGhW/kY5Kj9hSZ7ZtddLi4VK10iVPA72B5wm5sglig==", "license": "Apache-2.0", "dependencies": { - "@matter/general": "0.11.8", - "@matter/node": "0.11.8", - "@matter/protocol": "0.11.8", - "@matter/types": "0.11.8", + "@matter/general": "0.11.9-alpha.0-20241206-22f233334", + "@matter/node": "0.11.9-alpha.0-20241206-22f233334", + "@matter/protocol": "0.11.9-alpha.0-20241206-22f233334", + "@matter/types": "0.11.9-alpha.0-20241206-22f233334", "node-localstorage": "^3.0.5" }, "engines": { @@ -812,15 +812,15 @@ } }, "node_modules/@matter/nodejs-ble": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@matter/nodejs-ble/-/nodejs-ble-0.11.8.tgz", - "integrity": "sha512-vDgHL66wUomRJVFhHn0tjjgEZNl9kiKLsQfpNr6ZkMiU4e81o9IKO0pyeEjZ1A1VMVDIlYaSwAn/onuMA56dbA==", + "version": "0.11.9-alpha.0-20241206-22f233334", + "resolved": "https://registry.npmjs.org/@matter/nodejs-ble/-/nodejs-ble-0.11.9-alpha.0-20241206-22f233334.tgz", + "integrity": "sha512-xKQYmCdRQxlvROHmETiMhnPDTaLi2RUrwPZ67mcyXotLkc331czSx6Qr7jn9RqczaNn0N0evpUxHUNLR2tydYw==", "license": "Apache-2.0", "optional": true, "dependencies": { - "@matter/general": "0.11.8", - "@matter/protocol": "0.11.8", - "@matter/types": "0.11.8" + "@matter/general": "0.11.9-alpha.0-20241206-22f233334", + "@matter/protocol": "0.11.9-alpha.0-20241206-22f233334", + "@matter/types": "0.11.9-alpha.0-20241206-22f233334" }, "engines": { "node": ">=18.0.0" @@ -831,25 +831,25 @@ } }, "node_modules/@matter/protocol": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@matter/protocol/-/protocol-0.11.8.tgz", - "integrity": "sha512-/Sc/m2X4uEvMoO4g9gX17ZedPhYG2EYEmNvsX9zRMBnL+YAfX4/MrsOl+6Xr6Qe05n02doOpxaNodcQGJE5C/g==", + "version": "0.11.9-alpha.0-20241206-22f233334", + "resolved": "https://registry.npmjs.org/@matter/protocol/-/protocol-0.11.9-alpha.0-20241206-22f233334.tgz", + "integrity": "sha512-Eak16ov3YTwQ1p38QHZAw7Moc9ygHB1zg1UOc9rxY7yEhkpcjawbg19E+91IEPwf6cim5qnDjL/wSKP/CqN1Ug==", "license": "Apache-2.0", "dependencies": { - "@matter/general": "0.11.8", - "@matter/model": "0.11.8", - "@matter/types": "0.11.8", + "@matter/general": "0.11.9-alpha.0-20241206-22f233334", + "@matter/model": "0.11.9-alpha.0-20241206-22f233334", + "@matter/types": "0.11.9-alpha.0-20241206-22f233334", "@noble/curves": "^1.7.0" } }, "node_modules/@matter/types": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@matter/types/-/types-0.11.8.tgz", - "integrity": "sha512-APva+1an3NSNIP3KyYsHxQKEzSwmPn+6nWFIOCiRX3VC5+vTRRBYSAOg/0KMPApHhTrwjbB8R9AhBmPbTIVvdw==", + "version": "0.11.9-alpha.0-20241206-22f233334", + "resolved": "https://registry.npmjs.org/@matter/types/-/types-0.11.9-alpha.0-20241206-22f233334.tgz", + "integrity": "sha512-sAx4H6mwwJt8LIpkwC9EsLKSSLY/5WAMfvDXSl1ULK/UDKCb3wJ+3EpK/SF/YYQ+khdbbPXOxnoxEyfC3yZp/Q==", "license": "Apache-2.0", "dependencies": { - "@matter/general": "0.11.8", - "@matter/model": "0.11.8", + "@matter/general": "0.11.9-alpha.0-20241206-22f233334", + "@matter/model": "0.11.9-alpha.0-20241206-22f233334", "@noble/curves": "^1.7.0" } }, @@ -1012,16 +1012,16 @@ } }, "node_modules/@project-chip/matter.js": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@project-chip/matter.js/-/matter.js-0.11.8.tgz", - "integrity": "sha512-6wF2k7W0RNN0aknB9Vn7Yv3vOQzwcJ7XL3qXSMES62OIe5ZIjNteN3Co/vgyz6r4j2deAif4+4xcMMIy/RqPjA==", + "version": "0.11.9-alpha.0-20241206-22f233334", + "resolved": "https://registry.npmjs.org/@project-chip/matter.js/-/matter.js-0.11.9-alpha.0-20241206-22f233334.tgz", + "integrity": "sha512-zfTLPeCTgnrlc4XKwW9KNIxxf4OPYTNPJIYwYo8VHjR0YpQuTfzjVEAbb55BQmkBS4kK5aOlqDP/6HjukM8xmw==", "license": "Apache-2.0", "dependencies": { - "@matter/general": "0.11.8", - "@matter/model": "0.11.8", - "@matter/node": "0.11.8", - "@matter/protocol": "0.11.8", - "@matter/types": "0.11.8", + "@matter/general": "0.11.9-alpha.0-20241206-22f233334", + "@matter/model": "0.11.9-alpha.0-20241206-22f233334", + "@matter/node": "0.11.9-alpha.0-20241206-22f233334", + "@matter/protocol": "0.11.9-alpha.0-20241206-22f233334", + "@matter/types": "0.11.9-alpha.0-20241206-22f233334", "@noble/curves": "^1.7.0" } }, diff --git a/package.json b/package.json index 081c6c7c..37e7126a 100644 --- a/package.json +++ b/package.json @@ -23,16 +23,16 @@ "url": "https://github.com/ioBroker/ioBroker.matter" }, "optionalDependencies": { - "@matter/nodejs-ble": "0.11.8" + "@matter/nodejs-ble": "0.11.9-alpha.0-20241206-22f233334" }, "dependencies": { "@iobroker/adapter-core": "^3.2.2", "@iobroker/i18n": "^0.3.1", "@iobroker/dm-utils": "^0.6.9", "@iobroker/type-detector": "^4.0.1", - "@matter/main": "0.11.8", - "@matter/nodejs": "0.11.8", - "@project-chip/matter.js": "0.11.8", + "@matter/main": "0.11.9-alpha.0-20241206-22f233334", + "@matter/nodejs": "0.11.9-alpha.0-20241206-22f233334", + "@project-chip/matter.js": "0.11.9-alpha.0-20241206-22f233334", "axios": "^1.7.8", "jsonwebtoken": "^9.0.2" }, diff --git a/src-admin/package-lock.json b/src-admin/package-lock.json index 1a01496c..a6617f63 100644 --- a/src-admin/package-lock.json +++ b/src-admin/package-lock.json @@ -1,12 +1,12 @@ { "name": "iobroker.matter", - "version": "0.2.3", + "version": "0.2.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "iobroker.matter", - "version": "0.2.3", + "version": "0.2.4", "dependencies": { "@foxriver76/iob-component-lib": "^0.1.6", "@iobroker/adapter-react-v5": "^7.4.2", diff --git a/src-admin/src/Tabs/Bridges.tsx b/src-admin/src/Tabs/Bridges.tsx index afe524f4..a1c3605a 100644 --- a/src-admin/src/Tabs/Bridges.tsx +++ b/src-admin/src/Tabs/Bridges.tsx @@ -160,6 +160,7 @@ interface AddCustomDeviceDialog { detectedDeviceType?: Types; bridgeIndex: number; hasOnState?: boolean; + noComposed?: boolean; } interface BridgesState extends BridgesAndDevicesState { @@ -272,7 +273,7 @@ export class Bridges extends BridgesAndDevices { oid: device._id, type: device.deviceType, enabled: true, - noComposed: true, + noComposed: !!device.noComposed, auto: isAutoDetected, actionAllowedByIdentify: false, }; @@ -783,6 +784,7 @@ export class Bridges extends BridgesAndDevices { name, deviceType: '', bridgeIndex: this.bridgeIndex as number, + noComposed: false, }, }); } else { @@ -801,6 +803,7 @@ export class Bridges extends BridgesAndDevices { deviceType: SUPPORTED_DEVICES.includes(deviceType) ? deviceType : '', bridgeIndex: this.bridgeIndex as number, hasOnState: controls[0].devices[0].hasOnState, + noComposed: false, }, }); } @@ -988,6 +991,27 @@ export class Bridges extends BridgesAndDevices { ))} + { + if (!this.state.addCustomDeviceDialog) { + return; + } + + const addCustomDeviceDialog = clone(this.state.addCustomDeviceDialog); + addCustomDeviceDialog.noComposed = e.target.checked; + this.setState({ addCustomDeviceDialog }); + }} + /> + } + label={ + + {I18n.t('Do not compose devices (Alexa does not support composed devices yet)')} + + } + />