Skip to content

Commit

Permalink
Update logic to process domain data (#1442)
Browse files Browse the repository at this point in the history
- Added support to process domain data parsed from XML in both formats:
<domain>General</domain> and <domain name="General"/>
- The plan to update ZAP XMLs using Alchemy will require this change, as domain definitions will be updated to the format <domain name="General">
  • Loading branch information
ethanzhouyc authored Nov 4, 2024
1 parent 14050e7 commit bf5c7cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src-electron/zcl/zcl-loader-silabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,13 @@ function prepareCluster(cluster, context, isExtension = false) {
ret.name = cluster.name[0]
ret.description = cluster.description ? cluster.description[0].trim() : ''
ret.define = cluster.define[0]
ret.domain = cluster.domain[0]
// handle domain data parsed from both formats:
// <domain>General</domain> and <domain name="General"/>
if (cluster.domain[0] && cluster.domain[0].$) {
ret.domain = cluster.domain[0].$.name
} else {
ret.domain = cluster.domain[0]
}
ret.isSingleton = false
if ('$' in cluster) {
if (cluster.$.manufacturerCode == null) {
Expand Down

0 comments on commit bf5c7cc

Please sign in to comment.