diff --git a/qtoggleserver/mqtt/mqtteventhandler.py b/qtoggleserver/mqtt/mqtteventhandler.py index 0f899d3..b5dba1d 100644 --- a/qtoggleserver/mqtt/mqtteventhandler.py +++ b/qtoggleserver/mqtt/mqtteventhandler.py @@ -119,14 +119,13 @@ async def _client_loop(self) -> None: tls_context=tls_context, username=username, password=password, - client_id=client_id, + identifier=client_id, logger=self.client_logger, ) as client: self._mqtt_client = client - async with client.messages() as messages: - async for _ in messages: - # We don't really expect any message since we don't subscribe to any topic - await asyncio.sleep(1) + async for _ in client.messages: + # We don't really expect any message since we don't subscribe to any topic + await asyncio.sleep(1) except asyncio.CancelledError: self.debug('client task cancelled') self._mqtt_client = None diff --git a/setup.py b/setup.py index fad374b..8b4ab49 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,6 @@ packages=find_namespace_packages(), install_requires=[ - 'aiomqtt', + 'aiomqtt>=2.0', ] )