update json_data and model so more than one address can be revieved from server

This commit is contained in:
Adrian Zuercher
2025-07-30 17:16:50 +02:00
parent 3704edebd5
commit 49dff4f609
6 changed files with 24 additions and 11 deletions

View File

@@ -10,8 +10,12 @@ func (d *ArtNetDriver) Publish(pubs ...json_dataModels.Publish) error {
}
for _, pub := range pubs {
if drv, ok := (d.Subscriptions)[pub.Uuid]; ok {
d.SetValue(drv.Bus, drv.Address, uint8(pub.Value.(float64)))
if subs, ok := (d.Subscriptions)[pub.Uuid]; ok {
for _, sub := range subs {
for _, address := range sub.Address {
d.SetValue(sub.Bus, address, uint8(pub.Value.(float64)))
}
}
}
}
d.SendData()