From f95162336de028b75539813ccc633f9971160f34 Mon Sep 17 00:00:00 2001 From: Hasty Granbery Date: Tue, 5 Nov 2024 13:39:36 +0100 Subject: [PATCH] Upgrade or downgrade various warnings/errors --- dm/attribute.go | 4 +--- matter/spec/build.go | 7 +++++-- matter/spec/datatypes.go | 6 ++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dm/attribute.go b/dm/attribute.go index 68ff98d0..8e946661 100644 --- a/dm/attribute.go +++ b/dm/attribute.go @@ -147,10 +147,8 @@ func renderQuality(parent *etree.Element, q matter.Quality) { if fixed || nonvolatile { if fixed { qx.CreateAttr("persistence", "fixed") - } else if nonvolatile { - qx.CreateAttr("persistence", "nonVolatile") } else { - qx.CreateAttr("persistence", "volatile") + qx.CreateAttr("persistence", "nonVolatile") } } if reportable { diff --git a/matter/spec/build.go b/matter/spec/build.go index 78339b38..f35364ed 100644 --- a/matter/spec/build.go +++ b/matter/spec/build.go @@ -258,7 +258,7 @@ func associateDeviceTypeRequirementWithClusters(spec *Specification) { if c, ok := spec.ClustersByID[er.ClusterID.Value()]; ok { er.Cluster = c } else { - slog.Warn("unknown cluster ID for element requirement on device type", "clusterId", er.ClusterID.HexString(), "clusterName", er.ClusterName, "deviceType", dt.Name) + slog.Error("unknown cluster ID for element requirement on device type", "clusterId", er.ClusterID.HexString(), "clusterName", er.ClusterName, "deviceType", dt.Name) } } @@ -360,7 +360,10 @@ func getTagNamespace(spec *Specification, field *matter.Field) { return } } - slog.Warn("failed to match tag name space", slog.String("name", field.Name), log.Path("field", field), slog.String("namespace", field.Type.Name)) + if field.Type.Name != "tag" { + // Warn on unknown tag namespace, except for the example namespace "tag" + slog.Warn("failed to match tag name space", slog.String("name", field.Name), log.Path("field", field), slog.String("namespace", field.Type.Name)) + } } func clusterName(cluster *matter.Cluster) string { diff --git a/matter/spec/datatypes.go b/matter/spec/datatypes.go index a44760b3..07d61265 100644 --- a/matter/spec/datatypes.go +++ b/matter/spec/datatypes.go @@ -91,14 +91,12 @@ func (sp *Builder) resolveDataTypeReferences(spec *Specification) { func (sp *Builder) resolveDataType(spec *Specification, cluster *matter.Cluster, field *matter.Field, dataType *types.DataType) { if dataType == nil { - if !conformance.IsDeprecated(field.Conformance) && (cluster == nil || cluster.Hierarchy == "Base") { + if !conformance.IsDeprecated(field.Conformance) && !conformance.IsDisallowed(field.Conformance) && !sp.IgnoreHierarchy && (cluster == nil || cluster.Hierarchy == "Base") { var clusterName string if cluster != nil { clusterName = cluster.Name } - if !sp.IgnoreHierarchy { - slog.Warn("missing type on field", log.Path("path", field), slog.String("id", field.ID.HexString()), slog.String("name", field.Name), slog.String("cluster", clusterName)) - } + slog.Warn("missing type on field", log.Path("path", field), slog.String("id", field.ID.HexString()), slog.String("name", field.Name), slog.String("cluster", clusterName)) } return }