[FIX] iot: Build the url of iot_channel with dumps
Before, the url was built with string comprehension. Now json.dumps is use to ensure that the JSON sent is valid closes odoo/odoo#144125 Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
This commit is contained in:
@@ -61,7 +61,7 @@ class WebsocketClient(Thread):
|
||||
When the client is setup, this function send a message to subscribe to the iot websocket channel
|
||||
"""
|
||||
ws.send(
|
||||
'{"event_name":"subscribe","data":{"channels":["' + self.iot_channel + '"],"last":0}}'
|
||||
json.dumps({'event_name': 'subscribe', 'data': {'channels':[self.iot_channel], 'last': 0}})
|
||||
)
|
||||
|
||||
def __init__(self, url):
|
||||
|
||||
Reference in New Issue
Block a user