Skip to content

Commit fa70fde

Browse files
committed
fix: fixed an error in MQTT asset connection since all data must be sent in string format
1 parent cbdf149 commit fa70fde

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
88

99
[project]
1010
name = "smia"
11-
version = '0.3.2.5' # cambiar cuando funcione a 0.3.2
11+
version = '0.3.2.6' # cambiar cuando funcione a 0.3.2
1212
authors = [{ name="Ekaitz Hurtado", email="ekaitz.hurtado@ehu.eus" },]
1313
description = "Self-configurable Manufacturing Industrial Agents (SMIA)."
1414
readme = 'README_pypi.md'

src/smia/assetconnection/mqtt_asset_connection.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,13 @@ async def serialize_data_by_content_type(self, interaction_metadata, service_dat
228228

229229
match content_type.value:
230230
case 'application/json':
231-
# return json.dumps(service_data) # TODO ANALIZAR SI ES NECESARIO ENVIARLO EN STRING CON aiomqtt
232-
return service_data
231+
return json.dumps(service_data) # Data should be sent in string format
233232
case 'text/plain':
234233
return json.dumps(service_data)
235234
case 'application/xml':
236235
pass # Add the method to convert a JSON into XML
237236
case _:
238-
return service_data
237+
return str(service_data)
239238

240239
async def send_mqtt_request(self):
241240
"""

0 commit comments

Comments
 (0)