Skip to content

Commit

Permalink
Update for aiomqtt 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrisan committed Jan 21, 2024
1 parent 022d166 commit d09bd6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions qtoggleserver/mqtt/mqtteventhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
packages=find_namespace_packages(),

install_requires=[
'aiomqtt',
'aiomqtt>=2.0',
]
)

0 comments on commit d09bd6f

Please sign in to comment.