From 7fb447f8e846fd54ea2bbbf5b383102980d566d7 Mon Sep 17 00:00:00 2001 From: Ethel Morgan Date: Wed, 24 Jun 2020 23:29:18 +0100 Subject: update catbus library version to v0.0.3 --- cmd/catbus-actuator-wakeonlan/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cmd/catbus-actuator-wakeonlan') diff --git a/cmd/catbus-actuator-wakeonlan/main.go b/cmd/catbus-actuator-wakeonlan/main.go index 508d1cf..22157e9 100644 --- a/cmd/catbus-actuator-wakeonlan/main.go +++ b/cmd/catbus-actuator-wakeonlan/main.go @@ -37,22 +37,22 @@ func main() { log.AddField("broker-uri", config.BrokerURI) catbusOptions := catbus.ClientOptions{ - DisconnectHandler: func(_ *catbus.Client, err error) { + DisconnectHandler: func(_ catbus.Client, err error) { log := log if err != nil { log = log.WithError(err) } log.Error("disconnected from MQTT broker") }, - ConnectHandler: func(client *catbus.Client) { + ConnectHandler: func(client catbus.Client) { log.Info("connected to MQTT broker") for topic := range config.MACsByTopic { - err := client.Subscribe(topic, func(_ *catbus.Client, msg catbus.Message) { - if msg.Payload() != "on" { + err := client.Subscribe(topic, func(_ catbus.Client, msg catbus.Message) { + if msg.Payload != "on" { return } - mac, ok := config.MACsByTopic[msg.Topic()] + mac, ok := config.MACsByTopic[msg.Topic] if !ok { return } -- cgit v1.2.3