add state filtering to effect enforcer.

This commit is contained in:
2023-01-08 17:07:53 +01:00
parent 956bd970a0
commit 88036cfcae
2 changed files with 82 additions and 1 deletions
+11 -1
View File
@@ -30,7 +30,17 @@ func (c SetState) VerboseKey() string {
type SetStateBatch map[string]device.State
func (c SetStateBatch) CommandDescription() string {
return fmt.Sprintf("SetStateBatch(%d devices)", len(c))
b := strings.Builder{}
b.WriteByte('\n')
for key, value := range c {
b.WriteString(" ")
b.WriteString(key)
b.WriteString(": ")
b.WriteString(value.String())
b.WriteRune('\n')
}
return fmt.Sprintf("SetStateBatch(%s)", b.String())
}
func (c SetStateBatch) VerboseKey() string {