Files
tecamino-driver-artNet/models/jsonData.go
2025-04-21 09:56:30 +02:00

24 lines
374 B
Go

package models
type JsonData struct {
Set *[]Set `json:"set,omitempty"`
Create *[]Bus `json:"create,omitempty"`
}
func NewRequest() *JsonData {
return &JsonData{}
}
func (r *JsonData) AddSet(bus string, address uint, value uint8) {
if r.Set == nil {
r.Set = &[]Set{}
}
*r.Set = append(*r.Set, Set{
Bus: bus,
Address: address,
Value: value,
})
}