use Id function instead of accessing config directly

This commit is contained in:
Joel Wetzell
2025-12-10 07:44:55 -06:00
parent 8ca105a0b6
commit b59da597ba
14 changed files with 46 additions and 45 deletions

View File

@@ -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
}