@@ -149,7 +149,8 @@ def __init__(self, protocol: str, address: str, port: int,
149149 if kwargs .get ('enable_mqtt' ):
150150 if kwargs .get ('mqtt_port' ) is not None :
151151 self ._mqtt_port = kwargs .get ('mqtt_port' )
152- self ._mqtt_client = MQTTCommClient (url = self .address , port = self ._mqtt_port , client_id_suffix = uuid .uuid4 ().hex ,)
152+ self ._mqtt_client = MQTTCommClient (url = self .address , port = self ._mqtt_port ,
153+ client_id_suffix = uuid .uuid4 ().hex , )
153154 self ._mqtt_client .connect ()
154155 self ._mqtt_client .start ()
155156 # self._mqtt_client = MQTTCommClient(url=self.address + self.server_root, port=self._mqtt_port,
@@ -348,7 +349,7 @@ def init_mqtt(self):
348349 # self.get_mqtt_topic()
349350
350351 def _default_on_subscribe (self , client , userdata , mid , granted_qos , properties ):
351- print ("OSH Subscribed: " + str (mid )+ " " + str (granted_qos ))
352+ print ("OSH Subscribed: " + str (mid ) + " " + str (granted_qos ))
352353
353354 def get_mqtt_topic (self , subresource : APIResourceTypes | None = None ):
354355 """
@@ -358,7 +359,7 @@ def get_mqtt_topic(self, subresource: APIResourceTypes | None = None):
358359 """
359360 resource_type = None
360361 parent_res_type = None
361- res_id = None
362+ # res_id = None
362363 parent_id = None
363364
364365 if isinstance (self ._underlying_resource , ControlStreamResource ):
@@ -509,7 +510,6 @@ def publish(self, payload):
509510 """
510511 pass
511512
512-
513513 def _mqtt_sub_callback (self , client , userdata , msg ):
514514 print (f"Received MQTT message on topic { msg .topic } : { msg .payload } " )
515515 self ._msg_reader_queue .put_nowait (msg .payload )
0 commit comments