Skip to content

Commit

Permalink
removed randon number for MQTT
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuinigeRijder committed Jan 25, 2024
1 parent e543613 commit 8d7dc8c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions soliscloud_to_pvoutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import hashlib
import hmac
import json
import random
import time
import sys
import configparser
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8d7dc8c

Please sign in to comment.