Skip to content

Commit

Permalink
Update logic to process domain data
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 committed Oct 9, 2024
1 parent ce55106 commit 2566529
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 @@ -433,7 +433,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 2566529

Please sign in to comment.