new json_data model

This commit is contained in:
Adrian Zuercher
2025-05-04 22:21:12 +02:00
parent 7d6b09cf11
commit 5203fb8543
13 changed files with 79 additions and 45 deletions

View File

@@ -4,14 +4,16 @@ import (
json_dataModels "github.com/tecamino/tecamino-json_data/models"
)
func (d *DBMHandler) Set(sets []json_dataModels.Set) {
if sets == nil {
func (d *DBMHandler) Set(req *json_dataModels.Request) {
if req == nil {
return
} else if len(req.Set) == 0 {
return
}
d.RLock()
defer d.RUnlock()
for _, set := range sets {
for _, set := range req.Set {
for _, dp := range d.DB.QueryDatapoints(1, set.Path) {
dp.UpdateValue(d.Conns, set.Value)
}