Skip to content

Commit

Permalink
correct forwarding topic format
Browse files Browse the repository at this point in the history
  • Loading branch information
timcowlishaw committed May 13, 2024
1 parent ff64f85 commit 7710309
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/lib/mqtt_forwarder.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class MQTTForwarder
def initialize(client, prefix="forward/devices", suffix="readings")
def initialize(client)
@client = client
@prefix = prefix
@suffix = suffix
Expand All @@ -13,7 +13,7 @@ def forward_reading(token, device_id, reading)
private

def topic_path(token, device_id)
[prefix, token, device_id, suffix].join("/")
["/forward", token, "device", device_id, "readings"].join("/")
end

attr_reader :client, :prefix, :suffix
Expand Down

0 comments on commit 7710309

Please sign in to comment.