mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
use Id function instead of accessing config directly
This commit is contained in:
@@ -83,7 +83,7 @@ func (mc *MQTTClient) Run() error {
|
||||
|
||||
opts.OnConnect = func(c mqtt.Client) {
|
||||
token := mc.client.Subscribe(mc.Topic, 1, func(c mqtt.Client, m mqtt.Message) {
|
||||
mc.router.HandleInput(mc.config.Id, m)
|
||||
mc.router.HandleInput(mc.Id(), m)
|
||||
})
|
||||
token.Wait()
|
||||
}
|
||||
@@ -99,7 +99,7 @@ func (mc *MQTTClient) Run() error {
|
||||
}
|
||||
|
||||
<-mc.ctx.Done()
|
||||
slog.Debug("router context done in module", "id", mc.config.Id)
|
||||
slog.Debug("router context done in module", "id", mc.Id())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user