subscribe: set client_id for MQTT subscriber to ensure unique identification

This commit is contained in:
kristjank committed 2025-12-28 19:13:44 +01:00
1 parent fc3350efcc
commit 6fab87e35c
2 files changed
+16 -15

No files matched your search

+1
View File
@@ -32,6 +32,7 @@ client.on_connect = on_connect
client.on_message = on_message
if username:
client.username_pw_set(username, password)
client.client_id = f"subscribe-{os.getpid()}"
try:
client.connect(host, port, 60)