Skip to content

Commit 9b9bfef

Browse files
committed
mqtt: upgrade aiomqtt to 2.5 and fix related type issues
1 parent b44b1d9 commit 9b9bfef

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def main() -> None:
1414
author="Roman Novatorov",
1515
author_email="rnovatorov@enapter.com",
1616
install_requires=[
17-
"aiomqtt==2.4.*",
17+
"aiomqtt==2.5.*",
1818
"dnspython==2.8.*",
1919
"json-log-formatter==1.1.*",
2020
"httpx==0.28.*",

src/enapter/mqtt/api/device/channel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ async def subscribe_to_command_requests(
3030
) -> AsyncGenerator[CommandRequest, None]:
3131
async with self._subscribe("v1/command/requests") as messages:
3232
async for msg in messages:
33-
assert isinstance(msg.payload, str) or isinstance(msg.payload, bytes)
3433
yield CommandRequest.from_json(msg.payload)
3534

3635
async def publish_command_response(self, response: CommandResponse) -> None:

tests/unit/test_mqtt/test_api/test_device/test_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async def subscribe(topic: str):
1212
)
1313
yield enapter.mqtt.Message(
1414
topic=topic,
15-
payload='{"id": "bbe17a10-3107-47cb-b0ec-99648debade6", "name": "my_command", "arguments": {"foo": "bar"}}',
15+
payload=b'{"id": "bbe17a10-3107-47cb-b0ec-99648debade6", "name": "my_command", "arguments": {"foo": "bar"}}',
1616
qos=0,
1717
retain=False,
1818
mid=1,

0 commit comments

Comments
 (0)