Skip to content

Commit

Permalink
Using ../ when the partial with arguments is inside an if case which …
Browse files Browse the repository at this point in the history
…is under a block helper does not make it retrieve the parent context. However using parent. within the same if case retrieves the parent block helper's context. It is weird that ../ and parent. are not behaving the same way inside an inline partial with arguments.

Therefore moving the inline outside the if case and switching back to ../manufacturerCode and ../code instead of ../../manufacturerCode and ../../code
Github: ZAP#971
  • Loading branch information
brdandu committed Mar 31, 2023
1 parent ef57f11 commit 816eb61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ static void MTRClustersLogCompletion(NSString *logPrefix, id value, NSError *err
}

{{#zcl_commands}}
{{#if (is_str_equal source 'client')}}
{{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }}
{{#*inline "commandImpl"}}
{{! This is used as the implementation for both the new-name and old-name bits, so check for both here. }}
Expand All @@ -76,7 +75,7 @@ MTR{{cluster}}Cluster{{command}}Params
{{/inline}}
{{#*inline "clusterId"}}
{{#if (wasRemoved cluster command=command)}}
{{asMEI ../../manufacturerCode ../../code}}
{{asMEI ../manufacturerCode ../code}}
{{else}}
MTRClusterIDType{{cluster}}ID
{{/if}}
Expand Down Expand Up @@ -179,6 +178,7 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID
}
{{/unless}}
{{/inline}}
{{#if (is_str_equal source 'client')}}
{{> commandImpl cluster=(asUpperCamelCase parent.name preserveAcronyms=true)
command=(asUpperCamelCase name preserveAcronyms=true)}}
{{/if}}
Expand Down

0 comments on commit 816eb61

Please sign in to comment.