Skip to content

Commit

Permalink
mqtt version 2
Browse files Browse the repository at this point in the history
  • Loading branch information
YtvwlD committed Feb 20, 2024
1 parent d259fab commit a8aaac6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from pathlib import Path
import json
from paho.mqtt.client import Client as MqttClient
from paho.mqtt.client import CallbackAPIVersion as MqttCallbackAPIVersion
import toml

DSN_PATH = Path("/run/secrets/SIAMQTT_SENTRY_DSN")
Expand Down Expand Up @@ -88,7 +89,7 @@ def publish_to_mqtt(self) -> None:
],
handle_event,
)
mqtt = MqttClient()
mqtt = MqttClient(MqttCallbackAPIVersion.VERSION2)
mqtt.connect(config["mqtt"]["server"])

if "homeassistant" in config["mqtt"]:
Expand Down

0 comments on commit a8aaac6

Please sign in to comment.