From 34f287ff4812a7e6d5858fa7d0d57002f400f9d7 Mon Sep 17 00:00:00 2001 From: paulr34 <64710345+paulr34@users.noreply.github.com> Date: Fri, 15 Sep 2023 10:51:43 -0400 Subject: [PATCH] properly tagging storage option based on zcl.json (#1140) * properly tagging storage option based on zcl.json --- src-electron/db/query-config.js | 10 +++++++++- src-electron/zcl/zcl-loader-silabs.js | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src-electron/db/query-config.js b/src-electron/db/query-config.js index 743431c02d..e9fa1c8794 100644 --- a/src-electron/db/query-config.js +++ b/src-electron/db/query-config.js @@ -211,6 +211,14 @@ async function insertOrUpdateAttributeState( attributeId, clusterRef ) + if ( + staticAttribute.storagePolicy == + dbEnum.storagePolicy.attributeAccessInterface + ) { + staticAttribute.storagePolicy = dbEnum.storageOption.external + } else { + staticAttribute.storagePolicy = dbEnum.storageOption.ram + } if (staticAttribute == null) { throw new Error(`COULD NOT LOCATE ATTRIBUTE: ${attributeId} `) @@ -245,7 +253,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..1db35958db 100644 --- a/src-electron/zcl/zcl-loader-silabs.js +++ b/src-electron/zcl/zcl-loader-silabs.js @@ -560,6 +560,7 @@ function prepareCluster(cluster, context, isExtension = false) { if (context.listsUseAttributeAccessInterface && attribute.$.entryType) { storagePolicy = dbEnum.storagePolicy.attributeAccessInterface } else if ( + context.listsUseAttributeAccessInterface && context.attributeAccessInterfaceAttributes && context.attributeAccessInterfaceAttributes[cluster.name] && context.attributeAccessInterfaceAttributes[cluster.name].includes(name)