remodel json data for compatibility

This commit is contained in:
Adrian Zürcher
2025-04-26 23:14:50 +02:00
parent 85bd8de2a2
commit ea4719ff01
26 changed files with 672 additions and 550 deletions

20
models/drivers.go Normal file
View File

@@ -0,0 +1,20 @@
package models
type Drivers map[string]*Driver
type Driver struct {
Type string `json:"type,omitempty"`
Bus string `json:"bus"`
Address uint `json:"address"`
}
func NewDrivers() Drivers {
return make(Drivers)
}
func (d *Drivers) AddDriver(typ, bus string, address uint) {
(*d)[typ] = &Driver{
Bus: bus,
Address: address,
}
}