@@ -25,6 +25,7 @@ const queryZcl = require('../db/query-zcl')
2525const queryDeviceType = require ( '../db/query-device-type' )
2626const queryCommand = require ( '../db/query-command' )
2727const queryEvent = require ( '../db/query-event' )
28+ const queryPackage = require ( '../db/query-package' )
2829const dbEnum = require ( '../../src-shared/db-enum' )
2930const templateUtil = require ( './template-util' )
3031const helperC = require ( './helper-c' )
@@ -528,18 +529,24 @@ async function zcl_commands_with_cluster_info(options) {
528529async function zcl_commands_with_arguments ( options ) {
529530 let sortBy = options . hash . sortBy
530531 let packageIds = await templateUtil . ensureZclPackageIds ( this )
532+ let packages = await queryPackage . getPackagesByPackageIds (
533+ this . global . db ,
534+ packageIds
535+ )
531536
532537 let cmds = await Promise . all (
533- packageIds . map ( async ( packageId ) => {
538+ packages . map ( async ( pkg ) => {
534539 let cmdsPerPackageId = await queryCommand . selectAllCommandsWithArguments (
535540 this . global . db ,
536- packageId
541+ pkg . id
537542 )
538543 if ( 'signature' == sortBy ) {
539544 for ( const cmd of cmdsPerPackageId ) {
540545 let sig = await zclUtil . createCommandSignature (
541546 this . global . db ,
542- packageId ,
547+ pkg . type === dbEnum . packageType . zclXmlStandalone
548+ ? packageIds // If it's a custom xml, we need to pass all packages to have access to atomic types
549+ : pkg . id ,
543550 cmd
544551 )
545552 cmd . signature = sig . signature
@@ -2790,6 +2797,7 @@ async function as_zcl_type_size(type, options) {
27902797
27912798/**
27922799 * An if helper for comparisons
2800+
27932801 * @param {* } leftValue
27942802 * @param {* } rightValue
27952803 * @param {* } options
0 commit comments