Files
tecamino-dbm/dbm/system.go
Adrian Zuercher 48d05eec7e repo name change
2025-08-07 12:18:57 +02:00

30 lines
712 B
Go

package dbm
import (
"gitea.tecamino.com/paadi/tecamino-dbm/models"
json_dataModels "gitea.tecamino.com/paadi/tecamino-json_data/models"
"github.com/google/uuid"
)
func (d *DBMHandler) AddSystemDps() (err error) {
path := "System:Datapoints"
typ := json_dataModels.LOU
rights := json_dataModels.Read
_, err = d.DBM.CreateDatapoints(json_dataModels.Set{Path: path, Value: 0, Type: typ, Rights: rights})
if err != nil {
d.Log.Error("dmb.Handler.AddSystemDps", err.Error())
return err
}
models.SystemDatapoints = d.DBM.QueryDatapoints(1, uuid.Nil, path)[0].Uuid
if err = d.DBM.GoSystemTime(); err != nil {
return err
}
if err = d.DBM.GoSystemMemory(); err != nil {
return err
}
return
}