From 4b4587a286f5bf8ed50e70b2f34e917fcbf19d10 Mon Sep 17 00:00:00 2001 From: andig Date: Tue, 18 Jul 2023 18:43:34 +0200 Subject: [PATCH] Mqtt: fix setter not cleared --- provider/mqtt/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/provider/mqtt/client.go b/provider/mqtt/client.go index 8d4794ade..f0042a83e 100644 --- a/provider/mqtt/client.go +++ b/provider/mqtt/client.go @@ -137,7 +137,8 @@ func (m *Client) Listen(topic string, callback func(string)) { // ListenSetter creates a /set listener that resets the payload after handling func (m *Client) ListenSetter(topic string, callback func(string) error) { - m.Listen(topic+"/set", func(payload string) { + topic += "/set" + m.Listen(topic, func(payload string) { if err := callback(payload); err != nil { m.log.ERROR.Printf("set %s: %v", topic, err) }