package variables import "git.aiterp.net/lucifer3/server/internal/gentools" type Variables struct { Temperature map[string]AvgMinMax `json:"temperature"` Motion map[string]AvgMinMax `json:"motion"` } func (v Variables) WithPropertyPatch(patch PropertyPatch) Variables { if patch.Motion != nil { v.Motion = gentools.CopyMap(v.Motion) v.Motion[patch.Key] = *patch.Motion } if patch.Temperature != nil { v.Temperature = gentools.CopyMap(v.Temperature) v.Temperature[patch.Key] = *patch.Temperature } return v } type AvgMinMax struct { Avg float64 `json:"avg"` Min float64 `json:"min"` Max float64 `json:"max"` }