fix missing subscribe and publish on artNet Protocol

This commit is contained in:
Adrian Zuercher
2025-06-29 15:36:14 +02:00
parent 64ad4e8b3e
commit 473eb22b97
2 changed files with 38 additions and 6 deletions

17
driver/publish.go Normal file
View File

@@ -0,0 +1,17 @@
package driver
import (
json_dataModels "github.com/tecamino/tecamino-json_data/models"
)
func (d *ArtNetDriver) Publish(pubs ...json_dataModels.Publish) error {
if d.Subscriptions == nil {
return nil
}
for _, pub := range pubs {
if drv, ok := (d.Subscriptions)[pub.Uuid]; ok {
d.SetValue(drv.Bus, drv.Address, uint8(pub.Value.(float64)))
}
}
return nil
}