Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
  • Loading branch information
mrjerryjohns and bzbarsky-apple authored Oct 13, 2021
1 parent 9142fd2 commit 2dafbf1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/app/zap-templates/templates/app/cluster-objects.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,18 @@ namespace Attributes {
{{/first}}
{{#if clusterRef}}
namespace {{asUpperCamelCase label}} {
{{#if entryType}}
struct TypeInfo {
{{#if entryType}}
using Type = DataModel::List<{{zapTypeToEncodableClusterObjectType entryType}}>;
using DecodableType = DataModel::DecodableList<{{zapTypeToDecodableClusterObjectType entryType}}>;

static constexpr ClusterId GetClusterId() { return {{asUpperCamelCase parent.name}}::Id; }
static constexpr AttributeId GetAttributeId() { return Attributes::{{asUpperCamelCase label}}::Id; }
};
{{else}}
struct TypeInfo {
using Type = {{zapTypeToEncodableClusterObjectType type}};
using DecodableType = Type;
using DecodableType = {{zapTypeToDecodableClusterObjectType type}};;
{{/if}}

static constexpr ClusterId GetClusterId() { return {{asUpperCamelCase parent.name}}::Id; }
static constexpr AttributeId GetAttributeId() { return Attributes::{{asUpperCamelCase label}}::Id; }
};
{{/if}}
} // namespace {{asUpperCamelCase label}}
{{/if}}
{{#last}}
Expand Down
4 changes: 3 additions & 1 deletion src/app/zap-templates/templates/app/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ async function zapTypeToClusterObjectType(type, isDecodable, options)
{
if (StringHelper.isCharString(type)) {
return 'chip::Span<const char>';
} else if (type == 'single') {
}

if (type == 'single') {
return 'float';
}

Expand Down

0 comments on commit 2dafbf1

Please sign in to comment.