From 5b9435bff8ce11bbbf720084e27c2c6f471934f6 Mon Sep 17 00:00:00 2001 From: Ethel Morgan Date: Sat, 20 Jun 2020 00:31:20 +0100 Subject: only send WOL packets when set to "on" --- cmd/catbus-actuator-wakeonlan/main.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd') diff --git a/cmd/catbus-actuator-wakeonlan/main.go b/cmd/catbus-actuator-wakeonlan/main.go index ada08a0..53da4d9 100644 --- a/cmd/catbus-actuator-wakeonlan/main.go +++ b/cmd/catbus-actuator-wakeonlan/main.go @@ -51,6 +51,10 @@ func main() { for topic := range config.MACsByTopic { token := broker.Subscribe(topic, mqtt.AtLeastOnce, func(_ mqtt.Client, msg mqtt.Message) { + if string(msg.Payload()) != "on" { + return + } + mac, ok := config.MACsByTopic[msg.Topic()] if !ok { return -- cgit v1.2.3