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 +++++----- default.nix | 2 +- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 9 insertions(+), 7 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 } diff --git a/default.nix b/default.nix index 840aab3..97a3da6 100644 --- a/default.nix +++ b/default.nix @@ -10,7 +10,7 @@ buildGoModule rec { version = "latest"; goPackagePath = "go.eth.moe/catbus-wakeonlan"; - modSha256 = "0kll39ran2bl7w0l6a7866ka733cxyigx7gr3q4lfx2gxr6jqz8y"; + modSha256 = "1vv9g9g55zpq68snpk3m6ashzwipy5w3xng06l7i5pbjw1n27m0g"; src = ./.; diff --git a/go.mod b/go.mod index d33884c..ad9647a 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,6 @@ module go.eth.moe/catbus-wakeonlan go 1.14 require ( - go.eth.moe/catbus v0.0.2 + go.eth.moe/catbus v0.0.3 go.eth.moe/logger v0.0.1 ) diff --git a/go.sum b/go.sum index 276f6f5..563bf35 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ go.eth.moe/catbus v0.0.1 h1:hODPBqJQpbAJ0+n6iBAQfuoAKCvnOFmwkEGpKKvnB8Y= go.eth.moe/catbus v0.0.1/go.mod h1:bVYTqNPbc4QCACFDMTKFv/5cFZWYDKPSamTP0/lbvW0= go.eth.moe/catbus v0.0.2 h1:gTbmKzhTTs4O+cuq6Wlmj8KhRQuybe/qtdD88SwlzmI= go.eth.moe/catbus v0.0.2/go.mod h1:bVYTqNPbc4QCACFDMTKFv/5cFZWYDKPSamTP0/lbvW0= +go.eth.moe/catbus v0.0.3 h1:foZX7+kYuL3x7f1gX1qPeA3Y66D8I2Vs1RNfAkFXQmk= +go.eth.moe/catbus v0.0.3/go.mod h1:bVYTqNPbc4QCACFDMTKFv/5cFZWYDKPSamTP0/lbvW0= go.eth.moe/logger v0.0.1 h1:ncY0iuVIljShMQtwy+77DvoHDlu6zVZ+7XIT7jyprrY= go.eth.moe/logger v0.0.1/go.mod h1:G20TP3ON2S95olTep+qsBSoTfouZeKPukk3Ow42q5OQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -- cgit v1.2.3