From cb15c284a57eb7e946cc9349f2562097376e7749 Mon Sep 17 00:00:00 2001 From: Paul Regan Date: Thu, 14 Sep 2023 10:25:30 -0400 Subject: [PATCH 1/2] cleaning up storage policy code and fixing issue_1110 in the process --- src-electron/db/query-config.js | 2 +- src-electron/zcl/zcl-loader-silabs.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src-electron/db/query-config.js b/src-electron/db/query-config.js index 743431c02d..802e2a6b3d 100644 --- a/src-electron/db/query-config.js +++ b/src-electron/db/query-config.js @@ -245,7 +245,7 @@ INTO ENDPOINT_TYPE_ATTRIBUTE ( cluster.endpointTypeClusterId, attributeId, staticAttribute.defaultValue ? staticAttribute.defaultValue : '', - dbEnum.storageOption.ram, + staticAttribute.storagePolicy, clusterRef, reportMinInterval, reportMaxInterval, diff --git a/src-electron/zcl/zcl-loader-silabs.js b/src-electron/zcl/zcl-loader-silabs.js index a9f2a591a9..65c95ab0db 100644 --- a/src-electron/zcl/zcl-loader-silabs.js +++ b/src-electron/zcl/zcl-loader-silabs.js @@ -556,15 +556,15 @@ function prepareCluster(cluster, context, isExtension = false) { attribute.$.reportingPolicy ) } - let storagePolicy = dbEnum.storagePolicy.any + let storagePolicy = dbEnum.storageOption.ram if (context.listsUseAttributeAccessInterface && attribute.$.entryType) { - storagePolicy = dbEnum.storagePolicy.attributeAccessInterface + storagePolicy = dbEnum.storageOption.external } else if ( context.attributeAccessInterfaceAttributes && context.attributeAccessInterfaceAttributes[cluster.name] && context.attributeAccessInterfaceAttributes[cluster.name].includes(name) ) { - storagePolicy = dbEnum.storagePolicy.attributeAccessInterface + storagePolicy = dbEnum.storageOption.external } let att = { code: parseInt(attribute.$.code), From 8896e73732c6dbd33b32ab4ea26e305b79941215 Mon Sep 17 00:00:00 2001 From: Paul Regan Date: Thu, 14 Sep 2023 11:03:19 -0400 Subject: [PATCH 2/2] fix the conditional so the storage policy is only changed from default to external if it meets the conditions --- src-electron/zcl/zcl-loader-silabs.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src-electron/zcl/zcl-loader-silabs.js b/src-electron/zcl/zcl-loader-silabs.js index 65c95ab0db..d58c334986 100644 --- a/src-electron/zcl/zcl-loader-silabs.js +++ b/src-electron/zcl/zcl-loader-silabs.js @@ -557,9 +557,8 @@ function prepareCluster(cluster, context, isExtension = false) { ) } let storagePolicy = dbEnum.storageOption.ram - if (context.listsUseAttributeAccessInterface && attribute.$.entryType) { - storagePolicy = dbEnum.storageOption.external - } else if ( + if ( + context.listsUseAttributeAccessInterface && context.attributeAccessInterfaceAttributes && context.attributeAccessInterfaceAttributes[cluster.name] && context.attributeAccessInterfaceAttributes[cluster.name].includes(name)