Skip to content

Commit

Permalink
Merge pull request #25 from PatrickBaus/dependabot/pip/aiomqtt-approx…
Browse files Browse the repository at this point in the history
…-eq-2.0.0

[pip] Update aiomqtt requirement from ~=1.2.1 to ~=2.0.0
  • Loading branch information
PatrickBaus authored Jan 17, 2024
2 parents 4ae81bc + 2ac84d4 commit 5e0138e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ async def consumer( # pylint: disable=too-many-branches
last_reconnect_attempt = asyncio.get_running_loop().time()
try:
async with aiomqtt.Client(
hostname=self.__host, port=self.__port, client_id=f"Labkraken-{self.__node_id}_worker-{worker_name}"
hostname=self.__host,
port=self.__port,
identifier=f"Labkraken-{self.__node_id}_worker-{worker_name}",
) as mqtt_client:
self.__logger.info(
"Worker (%s): Successfully connected to MQTT broker (%s:%i).",
Expand Down Expand Up @@ -221,15 +223,15 @@ async def consumer( # pylint: disable=too-many-branches
event = None # Get a new event to publish
input_queue.task_done()
error_code = 0 # 0 = success
except aiomqtt.error.MqttCodeError as exc:
except aiomqtt.exceptions.MqttCodeError as exc:
self._log_mqtt_error_code(worker_name, error_code=exc.rc, previous_error_code=error_code)
error_code = exc.rc
except ConnectionRefusedError:
self._log_mqtt_error_code(
worker_name, error_code=111, previous_error_code=error_code
) # Connection refused is code 111
error_code = 111
except aiomqtt.error.MqttError as exc:
except aiomqtt.exceptions.MqttError as exc:
error = re.search(r"^\[Errno ([+-]?\d+)\]", str(exc))
if error is not None:
self._log_mqtt_error_code(
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aiostream~=0.5.2
aiomqtt~=1.2.1
aiomqtt~=2.0.0
beanie~=1.23.6
gpib-ctypes>=0.3.0
prologix-gpib-async~=1.4.13
Expand Down

0 comments on commit 5e0138e

Please sign in to comment.