diff --git a/debian b/debian index d70b64d..7f24f2b 100755 Binary files a/debian and b/debian differ diff --git a/internal/pkg/controller/manager.go b/internal/pkg/controller/manager.go index 9de570b..ab10fdc 100644 --- a/internal/pkg/controller/manager.go +++ b/internal/pkg/controller/manager.go @@ -19,6 +19,7 @@ func NewManager(max int) Manager { type ControllerManager struct { Manager + Name string *pb.Device @@ -31,6 +32,10 @@ func NewControllerManager(device *pb.Device) *ControllerManager { return &ControllerManager{Manager: m, Device: device} } +func (c *ControllerManager) GetName() string { + return c.Name +} + func (c *ControllerManager) GetDevice() *pb.Device { return c.Device } diff --git a/internal/pkg/reactor/devices.go b/internal/pkg/reactor/devices.go index 5803c57..ff6d83f 100644 --- a/internal/pkg/reactor/devices.go +++ b/internal/pkg/reactor/devices.go @@ -49,6 +49,7 @@ func (c *DeviceCoordinator) UpdateDevices(config *viper.Viper, i2c I2CClient, ac return err } // loading config + c.Managers[addr].LoadConfig("reactor") // check for config name // nameKey := fmt.Sprintf("device.%d.name", addr) diff --git a/internal/pkg/reactor/rlcoordinator.go b/internal/pkg/reactor/rlcoordinator.go index 7326fd4..91e245c 100644 --- a/internal/pkg/reactor/rlcoordinator.go +++ b/internal/pkg/reactor/rlcoordinator.go @@ -173,7 +173,7 @@ func (c *ReactorCoordinator) Monitor() { if err != nil { c.Err <- err } - go c.UpdateDevices(c.Config, c.I2C, active) + go c.DeviceCoordinator.UpdateDevices(c.Config, c.I2C, active) go c.Ping() } } diff --git a/internal/pkg/server/reactormanager.go b/internal/pkg/server/reactormanager.go index c791ef9..128cbb8 100644 --- a/internal/pkg/server/reactormanager.go +++ b/internal/pkg/server/reactormanager.go @@ -111,7 +111,6 @@ func (r *ReactorManager) UpdateDevices(devs []*pb.Device) { } else { // not found go r.AddDevice(dev, r.Id, r.Config, r.Err) - fmt.Printf("ID %d\n", r.Id) } } }