Skip to content

Commit

Permalink
fix: mqttv3 does not have properties
Browse files Browse the repository at this point in the history
  • Loading branch information
kpetremann committed Mar 28, 2024
1 parent e8e6a59 commit dad51e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mqtt_exporter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _create_msg_counter_metrics():
def subscribe(client, _, __, reason_code, properties):
"""Subscribe to mqtt events (callback)."""
user_data = {"client_id": settings.MQTT_CLIENT_ID}
if not settings.MQTT_CLIENT_ID:
if not settings.MQTT_CLIENT_ID and settings.MQTT_V5_PROTOCOL:
user_data["client_id"] = properties.AssignedClientIdentifier

client.user_data_set(user_data)
Expand Down

0 comments on commit dad51e3

Please sign in to comment.