From 8d7dc8c6c1cd86e41cb9384bb78c84d201af940f Mon Sep 17 00:00:00 2001 From: Zuinige Rijder Date: Thu, 25 Jan 2024 08:52:24 +0100 Subject: [PATCH] removed randon number for MQTT --- soliscloud_to_pvoutput.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/soliscloud_to_pvoutput.py b/soliscloud_to_pvoutput.py index 8f51e2d..4fce187 100644 --- a/soliscloud_to_pvoutput.py +++ b/soliscloud_to_pvoutput.py @@ -8,7 +8,6 @@ import hashlib import hmac import json -import random import time import sys import configparser @@ -287,9 +286,7 @@ def on_disconnect(client, userdata, rc): # pylint: disable=unused-argument reconnect_count += 1 logging.info("Reconnect failed after %s attempts. Exiting...", reconnect_count) - mqtt_client_id = ( - f"{MQTT_MAIN_TOPIC}-{SOLISCLOUD_INVERTER_SN}-{random.randint(0, 1000)}" - ) + mqtt_client_id = f"{MQTT_MAIN_TOPIC}-{SOLISCLOUD_INVERTER_SN}" client = mqtt_client.Client(mqtt_client_id) client.on_connect = on_connect client.on_disconnect = on_disconnect