diff options
author | Ethel Morgan <eth@ethulhu.co.uk> | 2020-06-24 23:29:18 +0100 |
---|---|---|
committer | Ethel Morgan <eth@ethulhu.co.uk> | 2020-06-24 23:29:18 +0100 |
commit | 7fb447f8e846fd54ea2bbbf5b383102980d566d7 (patch) | |
tree | d3e4801f6b14ab6c0ce4e2349b80ce47b236fa0c /cmd | |
parent | ee95cf1f3a8b8d38e551261479fc66a113ebeedb (diff) |
update catbus library version to v0.0.3
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/catbus-actuator-wakeonlan/main.go | 10 |
1 files changed, 5 insertions, 5 deletions
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 } |