Skip to content

Commit

Permalink
Upgrade or downgrade various warnings/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hasty committed Nov 5, 2024
1 parent f2523d2 commit f951623
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 1 addition & 3 deletions dm/attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 5 additions & 2 deletions matter/spec/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}
}
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 2 additions & 4 deletions matter/spec/datatypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f951623

Please sign in to comment.