Skip to content

Commit

Permalink
Fix device prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
misery committed May 23, 2021
1 parent 2a754de commit 62d6a39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
}
Expand All @@ -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)
}
}
Expand Down

0 comments on commit 62d6a39

Please sign in to comment.