modify drivers

This commit is contained in:
Adrian Zuercher
2025-07-29 12:37:04 +02:00
parent eabac1b11b
commit 4221815def
5 changed files with 62 additions and 25 deletions

View File

@@ -41,8 +41,8 @@ func (s *Set) NewDriverAddress(typ, bus string, address uint) {
if s.Drivers == nil {
s.Drivers = &Drivers{}
}
drv := s.Drivers.AddDriver(typ)
b := drv.AddBus(bus)
drv := s.Drivers.AddNewDriver(typ)
b := drv.AddNewBus(bus)
b.AddAddress(address)
}
@@ -51,8 +51,8 @@ func (s *Set) NewDriverSubscribe(typ, bus string, sub string) {
if s.Drivers == nil {
s.Drivers = &Drivers{}
}
drv := s.Drivers.AddDriver(typ)
b := drv.AddBus(bus)
drv := s.Drivers.AddNewDriver(typ)
b := drv.AddNewBus(bus)
b.AddSubscription(sub)
}
@@ -61,7 +61,7 @@ func (s *Set) NewDriverPublish(typ, bus string, pub string) {
if s.Drivers == nil {
s.Drivers = &Drivers{}
}
drv := s.Drivers.AddDriver(typ)
b := drv.AddBus(bus)
drv := s.Drivers.AddNewDriver(typ)
b := drv.AddNewBus(bus)
b.AddPublish(pub)
}