From 62d6a394f2d5c939a64edc4e1b9faf180bb61361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= Date: Sun, 23 May 2021 23:20:33 +0200 Subject: [PATCH] Fix device prefix --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index a0fd82d..ad7b335 100644 --- a/main.go +++ b/main.go @@ -217,7 +217,7 @@ func refreshRoomInformation(bridge *bridgeCfg, number string) { for i := 0; i < len(c.Entries); i++ { name := strings.Replace(c.Entries[i].Name, ".", "/", -1) - t := fmt.Sprint(bridge.Topic, name) + t := fmt.Sprint(bridge.Topic, "/", name) value := fetchTemperature(name, c.Entries[i].Value) publish(bridge, t, value) } @@ -232,7 +232,7 @@ func refresh(bridge *bridgeCfg) { prefix := fmt.Sprint("G", i) log.Println("Add room:", prefix) for _, name := range roomSetFields { - topic := fmt.Sprint(bridge.Topic, prefix, "/set/", name) + topic := fmt.Sprint(bridge.Topic, "/", prefix, "/set/", name) listen(bridge, topic) } } @@ -244,7 +244,7 @@ func refresh(bridge *bridgeCfg) { prefix := fmt.Sprint("G", i) log.Println("Remove room:", prefix) for _, name := range roomSetFields { - topic := fmt.Sprint(bridge.Topic, prefix, "/set/", name) + topic := fmt.Sprint(bridge.Topic, "/", prefix, "/set/", name) bridge.Client.Unsubscribe(topic) } }