
All checks were successful
Build ArtNet Driver / build (amd64, , linux) (push) Successful in 1m40s
Build ArtNet Driver / build (amd64, .exe, windows) (push) Successful in 1m41s
Build ArtNet Driver / build (arm, 6, , linux) (push) Successful in 1m39s
Build ArtNet Driver / build (arm64, , linux) (push) Successful in 1m38s
24 lines
475 B
Go
24 lines
475 B
Go
package driver
|
|
|
|
import (
|
|
json_dataModels "gitea.tecamino.com/paadi/tecamino-json_data/models"
|
|
)
|
|
|
|
func (d *ArtNetDriver) Publish(pubs ...json_dataModels.Publish) error {
|
|
if d.Subscriptions == nil {
|
|
return nil
|
|
}
|
|
|
|
for _, pub := range pubs {
|
|
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()
|
|
return nil
|
|
}
|