1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
From: Edward Betts <edward@4angle.com>
Date: Thu, 13 Nov 2025 12:18:13 +0000
Subject: Rename exceptions for new amqtt
---
volvooncall/mqtt.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/volvooncall/mqtt.py b/volvooncall/mqtt.py
index 6aac962..68eaf4d 100755
--- a/volvooncall/mqtt.py
+++ b/volvooncall/mqtt.py
@@ -11,7 +11,7 @@ from platform import node as hostname
import asyncio
import certifi
-from amqtt.client import ClientException, ConnectException, MQTTClient
+from amqtt.client import ClientError, ConnectError, MQTTClient
from .dashboard import Lock, Position, Sensor, BinarySensor, Switch
from .util import camel2slug, whitelisted, owntracks_encrypt
@@ -409,7 +409,7 @@ async def run(voc, config):
try:
await mqtt.connect(url, cleansession=False, cafile=certifi.where())
_LOGGER.info("Connected to MQTT server")
- except ConnectException as e:
+ except ConnectError as e:
exit("Could not connect to MQTT server: %s" % e)
while True:
_LOGGER.debug("Waiting for messages")
@@ -420,7 +420,7 @@ async def run(voc, config):
payload = packet.payload.data.decode("ascii")
_LOGGER.debug("got message on %s: %s", topic, payload)
Entity.route_message(topic, payload)
- except ClientException as e:
+ except ClientError as e:
_LOGGER.error("MQTT Client exception: %s", e)
asyncio.create_task(mqtt_task()) # pylint:disable=no-member
|