From 07da0cf182f90b0f137676ea7f516735246380ab Mon Sep 17 00:00:00 2001 From: Alp SARICA Date: Tue, 12 Mar 2024 11:47:49 +0300 Subject: [PATCH] moved self.twin_topic above mqtt client creating line --- agent/mqtt.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/agent/mqtt.py b/agent/mqtt.py index 54b9066..2d27ace 100755 --- a/agent/mqtt.py +++ b/agent/mqtt.py @@ -65,6 +65,8 @@ def __init__(self): self.gateway_to_agent_topic = self.get_parameter("gateway_to_agent_topic").value self.thing_messages_topic = self.get_parameter("thing_messages_topic").value + + self.twin_topic = f"{self.prefix}/{self.namespace}:{self.name}" # MQTT Client self.mqtt = Client( @@ -94,9 +96,6 @@ def __init__(self): self.pub_thing = self.create_publisher(Thing, self.thing_messages_topic, 10) - # Other - self.twin_topic = f"{self.prefix}/{self.namespace}:{self.name}" - def __del__(self): self.mqtt.loop_stop() self.mqtt.disconnect()