Skip to content

Commit

Permalink
migrate asyncio-mqtt to aiomqtt (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
markusressel committed May 29, 2024
1 parent 9e9ddd4 commit 6efa771
Show file tree
Hide file tree
Showing 3 changed files with 449 additions and 408 deletions.
4 changes: 2 additions & 2 deletions barcode_server/notifier/mqtt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from asyncio_mqtt import Client
from aiomqtt import Client
from prometheus_async.aio import time

from barcode_server.barcode import BarcodeEvent
Expand Down Expand Up @@ -33,6 +33,6 @@ async def _send_event(self, event: BarcodeEvent):
json = barcode_event_to_json(self.config.INSTANCE_ID.value, event)
async with Client(hostname=self.host, port=self.port,
username=self.user, password=self.password,
client_id=self.client_id) as client:
identifier=self.client_id) as client:
await client.publish(self.topic, json, self.qos, self.retain)
LOGGER.debug(f"Notified {self.host}:{self.port}: {event.barcode}")
Loading

0 comments on commit 6efa771

Please sign in to comment.