GitPedia
empicano

empicano/aiomqtt

The idiomatic asyncio MQTT client

30 Releases
Latest: 2mo ago
v3.0.0-alpha.1LatestPre-release
empicanoempicano·2mo ago·April 2, 2026
GitHub

📋 Changes

  • Replace paho-mqtt dependency with [mqtt5](https://github.com/empicano/mqtt5)
  • Drop support for MQTTv3.1 and MQTTv3.1.1
  • All `Client` parameters are now keyword-only
  • Messages are now `mqtt5.PublishPacket` instances instead of `aiomqtt.Message`
  • `publish` payload is now a positional `bytes` argument instead of keyword `payload=`
  • `client.messages` is now `client.messages()` (method call)
  • `message.mid` renamed to `message.packet_id`
  • `message.properties` replaced by individual attributes (e.g. `message.content_type`, `message.user_properties`)
  • + 11 more
v2.5.1
empicanoempicano·3mo ago·March 5, 2026
GitHub

🐛 Fixed

  • Fix failure to load TLS with `tls_params` and `tls_insecure=True` (@okaresz in 386)
v2.5.0
empicanoempicano·5mo ago·January 4, 2026
GitHub

🐛 Fixed

  • Fix the type hint for `Message.payload` from `PayloadType` to `bytes` (@meronepy in #370)
  • Let exceptions bubble up in `Client.__aexit__` instead of suppressing them (@yujia21 in #375)
  • Load TLS certs from the executor thread (@allenporter in #382)
v2.4.0
empicanoempicano·1y ago·May 3, 2025
GitHub

Added

  • Allow `proxy_port` to be passed to the underlying paho `proxy_set()` function (@NickJHoffmann in #339)

🐛 Fixed

  • Fix retained message delayed on TLS connection (@wpickard in #343)
v2.3.2
empicanoempicano·1y ago·April 8, 2025
GitHub

Added

  • Test for Python 3.13 (@empicano in #359)

🐛 Fixed

  • Add missing version attributes after uv switch (@empicano in #359)
v2.3.1
empicanoempicano·1y ago·March 31, 2025
GitHub

📋 Changed

  • Switch from poetry to uv (@pavel-anchev in #350)

🐛 Fixed

  • Consistently use `sock.fileno()` to identify socket for monitoring (@airtower-luna in #357)
  • Replace deprecated `get_event_loop` with `get_running_loop`
v2.3.0
empicanoempicano·1y ago·August 6, 2024
GitHub

Added

  • Implement `len(client.messages)` to return number of messages in queue (@empicano in #323)

📋 Changed

  • Update FastAPI docs to use dependency injection (@odie5533 in #321)
v2.2.0
empicanoempicano·1y ago·July 1, 2024
GitHub

📋 Changed

  • Bump paho-mqtt to 2.1 (@empicano in #305)
  • Migrate to paho-mqtt callback v2 (@empicano in #313)

🐛 Fixed

  • Fix `Client.messages` not being reusable (@ryan-summers in #312)
v2.1.0
empicanoempicano·2y ago·April 24, 2024
GitHub

📋 Changed

  • Migrate to paho-mqtt 2.0 (@JonathanPlasse in #286)
v2.0.1
empicanoempicano·2y ago·March 13, 2024
GitHub

🐛 Fixed

  • Configure `poetry-dynamic-versioning` to replace `__version__` and `__version_tuple__` variables (@vvanglro in #273)
  • Reset internal state when connection attempt in `__aenter__` times out (@empicano in #285)
v2.0.0
empicanoempicano·2y ago·January 15, 2024
GitHub

Added

  • Test for Python 3.12 (@JonathanPlasse in #256)
  • Add migration guide (@empicano in #262)

📋 Changed

  • Switch to client-wide queue (@empicano in #262)
  • Switch from black to Ruff and update dev dependencies (@JonathanPlasse in #255)
  • Rename `Client.id` attribute to `identifier` (@empicano in #262)

🐛 Fixed

  • Release reusability correctly to allow consecutive calls to `__aexit__` (@spacemanspiff2007 in #263)

🗑️ Removed

  • Remove deprecated `connect`/`disconnect` methods (@empicano in #262)
  • Remove deprecated `filtered_messages` and `unfiltered_messages` methods (@empicano in #262)
  • Remove deprecated `message_retry_set` client argument (@empicano in #262)
  • ---
  • This release introduces breaking changes. You can find a [migration guide](https://sbtinstruments.github.io/aiomqtt/migration-guide-v2.html) in the documentation.
v1.2.1
empicanoempicano·2y ago·September 19, 2023
GitHub

📋 Changed

  • Deprecate `connect` and `disconnect` in favor of direct calls to `__aenter__` and `__aexit__`. (@empicano in #247)

🐛 Fixed

  • Release lock in `__aexit__` only if acquired (@spacemanspiff2007 in #249)
v1.2.0
empicanoempicano·2y ago·September 3, 2023
GitHub

📋 Changed

  • Drop support for Python 3.7. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#246](https://github.com/sbtinstruments/aiomqtt/pull/246)

🐛 Fixed

  • Fix `__aenter__` failing to release lock when initial connection fails. Contributed by [Peanut (@vvanglro)](https://github.com/vvanglro) in [#245](https://github.com/sbtinstruments/aiomqtt/pull/245)
v1.1.0
empicanoempicano·2y ago·August 3, 2023
GitHub

Added

  • Expose paho's `tls_insecure` argument. Contributed by [Bob Steers (@steersbob)](https://github.com/steersbob) in [#234](https://github.com/sbtinstruments/asyncio-mqtt/pull/234)
  • Add reference section generated from docstrings to documentation. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#231](https://github.com/sbtinstruments/asyncio-mqtt/pull/231)

🐛 Fixed

  • Don't suppress exceptions in the client's `__aexit__`. Contributed by [Robert Resch (@edenhaus)](https://github.com/edenhaus) in [#232](https://github.com/sbtinstruments/aiomqtt/pull/232)
  • Match `topic/subtopic` with `topic/subtopic/#` wildcard according to MQTT documentation. Contributed by [Bob Steers (@steersbob)](https://github.com/steersbob) in [#241](https://github.com/sbtinstruments/asyncio-mqtt/pull/241)
v1.0.0
empicanoempicano·3y ago·June 16, 2023
GitHub

Added

  • Move documentation from `README` to Sphinx. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#159](https://github.com/sbtinstruments/asyncio-mqtt/pull/159)
  • Add CI workflow to deploy documentation to GitHub Pages. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#159](https://github.com/sbtinstruments/asyncio-mqtt/pull/159)
  • Add Flow Control options to the Client-Constructor. Contributed by [Andreas Heine (@andreasheine)](https://github.com/andreasheine) in [#180](https://github.com/sbtinstruments/asyncio-mqtt/pull/180)
  • Make `Client.pending_calls_threshold` public. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#185](https://github.com/sbtinstruments/asyncio-mqtt/pull/185)
  • Make Client a reusable (but not reentrant) context manager. Contributed by [Peanut (@vvanglro)](https://github.com/vvanglro) in [#216](https://github.com/sbtinstruments/asyncio-mqtt/pull/216)
  • Make default timeout configurable. Contributed by [Scott P. (@skewty)](https://github.com/skewty) in [#192](https://github.com/sbtinstruments/asyncio-mqtt/pull/192)

📋 Changed

  • Switch from pip to poetry for dependency management. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#210](https://github.com/sbtinstruments/asyncio-mqtt/pull/210)
  • Rename project from asyncio-mqtt to aiomqtt. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#210](https://github.com/sbtinstruments/asyncio-mqtt/pull/210)

🗑️ Removed

  • Rename `master` branch to `main`. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse)

🐛 Fixed

  • Consistently use a user-provided logger. Contributed by [Roman Novatorov (@rnovatorov)](https://github.com/rnovatorov) in [#176](https://github.com/sbtinstruments/asyncio-mqtt/pull/176)
v0.16.1
JonathanPlasseJonathanPlasse·3y ago·December 6, 2022
GitHub

🐛 Fixed

  • Add properties in Message, the last release skipped this commit. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse)
v0.16.0
JonathanPlasseJonathanPlasse·3y ago·December 5, 2022
GitHub

Added

  • Add properties in Message. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#166](https://github.com/sbtinstruments/asyncio-mqtt/pull/166)

📋 Changed

  • Update Ruff version to 0.0.158 and fix new lint errors. Contributed by [pre-commit-ci](https://github.com/apps/pre-commit-ci) and [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#161](https://github.com/sbtinstruments/asyncio-mqtt/pull/161)

🐛 Fixed

  • Fix typo in description metadata. Contributed by [(@pi-slh)](https://github.com/pi-slh) in [#162](https://github.com/sbtinstruments/asyncio-mqtt/pull/162)
v0.15.0
empicanoempicano·3y ago·November 27, 2022
GitHub

Added

  • Allow multiple message generators at the same time. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#147](https://github.com/sbtinstruments/asyncio-mqtt/pull/147)

📋 Changed

  • Simplify message filtering. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#147](https://github.com/sbtinstruments/asyncio-mqtt/pull/147)
  • Switch from `flake8` to `ruff` for linting. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#155](https://github.com/sbtinstruments/asyncio-mqtt/pull/155)
v0.14.0
JonathanPlasseJonathanPlasse·3y ago·November 7, 2022
GitHub

Added

  • Add [pre-commit](https://pre-commit.com/) for continuous integration. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#144](https://github.com/sbtinstruments/asyncio-mqtt/pull/144)
  • Add tests and coverage for continuous integration. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#145](https://github.com/sbtinstruments/asyncio-mqtt/pull/145) and [#149](https://github.com/sbtinstruments/asyncio-mqtt/pull/149)
  • Add continuous deployment to PyPI. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#151](https://github.com/sbtinstruments/asyncio-mqtt/pull/151)

📋 Changed

  • Reorder `README.md` sections in order of importance. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#140](https://github.com/sbtinstruments/asyncio-mqtt/pull/140)
  • Change from `setup.py` to `pyproject.toml`. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#151](https://github.com/sbtinstruments/asyncio-mqtt/pull/151)

🗑️ Deprecated

  • Deprecate `master` branch in favor of `main` branch.

🗑️ Removed

  • Drop Python 3.6 support. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#146](https://github.com/sbtinstruments/asyncio-mqtt/pull/146)

🐛 Fixed

  • Fix lifespan example in `README.md`. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) and [Felix Böhm (@empicano)](https://github.com/empicano) in [#135](https://github.com/sbtinstruments/asyncio-mqtt/pull/135)
v0.13.0
frederikaalundfrederikaalund·3y ago·October 16, 2022
GitHub

Added

  • Add `proxy` and `tls_params` examples to `README.md`. Contributed by [Muhammad Sohaib Arshid (@Sohaib90)](https://github.com/Sohaib90) in [#128](https://github.com/sbtinstruments/asyncio-mqtt/pull/128)
  • Add `proxy` option. Contributed by [Muhammad Sohaib Arshid (@Sohaib90)](https://github.com/Sohaib90) in [#127](https://github.com/sbtinstruments/asyncio-mqtt/pull/127)
  • Add `tls_params` option. Contributed by [Muhammad Sohaib Arshid (@Sohaib90)](https://github.com/Sohaib90) in [#126](https://github.com/sbtinstruments/asyncio-mqtt/pull/126)
  • Add WebSocket connection options. Contributed by [Dustin C. Hatch (@AdmiralNemo)](https://github.com/AdmiralNemo) in [#115](https://github.com/sbtinstruments/asyncio-mqtt/pull/115)
  • Add LICENSE to tarballs produced during build. Contributed by [Stewart Haines (@stewarthaines)](https://github.com/stewarthaines) in [#107](https://github.com/sbtinstruments/asyncio-mqtt/pull/107)

📋 Changed

  • Rework type hints of the entire project to make it compliant with mypy in strict mode. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#133](https://github.com/sbtinstruments/asyncio-mqtt/pull/133)
  • Rework related projects in `README.md`. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#132](https://github.com/sbtinstruments/asyncio-mqtt/pull/132)
  • Increase LoC count from 600 to 700 in `README.md`.

🐛 Fixed

  • Fix autocomplete for `_outgoing_call` decorator. Contributed by [Jonathan Plasse (@JonathanPlasse)](https://github.com/JonathanPlasse) in [#134](https://github.com/sbtinstruments/asyncio-mqtt/pull/134)
  • Fix missing ProtocolVersion import in `README.md` and format the entire `README.md`. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#130](https://github.com/sbtinstruments/asyncio-mqtt/pull/130)
  • Fix 'asyncio_mqtt' has no attribute 'TLSParameters' error. Contributed by [Felix Böhm (@empicano)](https://github.com/empicano) in [#129](https://github.com/sbtinstruments/asyncio-mqtt/pull/129)
  • Fix formatting in `README.md`. Contributed by [Marcelo Trylesinski (@Kludex)](https://github.com/Kludex) in [#128](https://github.com/sbtinstruments/asyncio-mqtt/pull/128)
  • Fix race conditions that may cause `InvalidStateError`. Contributed by [Andreas Hangauer (@aha79)](https://github.com/aha79) in [#123](https://github.com/sbtinstruments/asyncio-mqtt/pull/123)
  • Fix thread safety in socket close callback. Contributed by [Dustin C. Hatch (@AdmiralNemo)](https://github.com/AdmiralNemo) in [#114](https://github.com/sbtinstruments/asyncio-mqtt/pull/114)
v0.12.1
frederikaalundfrederikaalund·4y ago·January 19, 2022
GitHub

🐛 Fixed

  • Fix `TypeError` with the new `_outgoing_call` decorator.
v0.12.0
frederikaalundfrederikaalund·4y ago·January 19, 2022
GitHub

Added

  • Add backpressure mechanism to limit the number of concurrent outgoing calls. Contributed by [Aaron Bach (@bachya)](https://github.com/bachya) in [#72](https://github.com/sbtinstruments/asyncio-mqtt/pull/101)
v0.11.1
frederikaalundfrederikaalund·4y ago·January 10, 2022
GitHub

🐛 Fixed

  • Fix race condition in the "advanced example" in `README.md`. Contributed by [Steve Palmer (@steverpalmer)](https://github.com/steverpalmer) in [#93](https://github.com/sbtinstruments/asyncio-mqtt/pull/93)
  • Make `password` keyword argument optional (as it always should have been). Contributed by [@Shikoruma](https://github.com/Shikoruma) in [#89](https://github.com/sbtinstruments/asyncio-mqtt/pull/89)
  • Fix false postive type error from Pyright regarding `asynccontextmanager`. Contributed by [Shawn Wilsher (@sdwilsh)](https://github.com/sdwilsh) in [#87](https://github.com/sbtinstruments/asyncio-mqtt/pull/87)
  • Fix type hints (mostly related to async_generator). Contributed by [@laundmo](https://github.com/laundmo) in [#86](https://github.com/sbtinstruments/asyncio-mqtt/pull/86)
v0.11.0
frederikaalundfrederikaalund·4y ago·November 4, 2021
GitHub

Added

  • Add link to PyPI package with a badge in `README.md`. Contributed by [Paul Barker (@pbrkr)](https://github.com/pbrkr) in [#72](https://github.com/sbtinstruments/asyncio-mqtt/pull/72)

📋 Changed

  • Convert reason codes into English error messages. Contributed by [@CptSpaceToaster](https://github.cm/CptSpaceToaster) in [#74](https://github.com/sbtinstruments/asyncio-mqtt/pull/74)

🐛 Fixed

  • Fix event loop block caused by paho's reconnection feature. Contributed by [Martin Hjelmare (@MartinHjelmare)](https://github.cm/MartinHjelmare) in [#85](https://github.com/sbtinstruments/asyncio-mqtt/pull/85)
v0.10.0
frederikaalundfrederikaalund·4y ago·July 13, 2021
GitHub

Added

  • Add new parameter `socket_options` to `Client.__init__`. Contributed by [@xydan83](https://github.com/xydan83) in [#71](https://github.com/sbtinstruments/asyncio-mqtt/pull/71)
  • Add new parameter `message_retry_set` to `Client.__init__`. Contributed by [@xydan83](https://github.com/xydan83) in [#69](https://github.com/sbtinstruments/asyncio-mqtt/pull/69)
  • Export `ProtocolVersion` from the main module. Contributed by [André (@tropxy)](https://github.com/tropxy) in [#65](https://github.com/sbtinstruments/asyncio-mqtt/pull/65) (1/2)
  • Add documentation about publishers, client arguments, etc. Contributed by [André (@tropxy)](https://github.com/tropxy) in [#65](https://github.com/sbtinstruments/asyncio-mqtt/pull/65) (2/2)

🐛 Fixed

  • Fix race condition that caused `InvalidStateError` in `force_disconnect()`. Contributed by [@functionpointer](https://github.com/functionpointer) in [#67](https://github.com/sbtinstruments/asyncio-mqtt/pull/67)
v0.9.1
frederikaalundfrederikaalund·5y ago·May 13, 2021
GitHub

🐛 Fixed

  • Fix handling of MQTTv5 reason codes. Contributed by [Jakob Schlyter (@jschlyter)](https://github.com/jschlyter) [#59](https://github.com/sbtinstruments/asyncio-mqtt/pull/59)
  • Account for `-1` socket handles in the close callback. Contributed by [@wrobell](https://github.com/wrobell) [#60](https://github.com/sbtinstruments/asyncio-mqtt/pull/60)
v0.9.0
frederikaalundfrederikaalund·5y ago·May 3, 2021
GitHub

📋 Changes

  • Add type hints. Contributed by [Ellis Percival (@flyte)](https://github.com/flyte) [#37](https://github.com/sbtinstruments/asyncio-mqtt/pull/37)
  • Add the `keepalive`, `bind_address`, `bind_port`, `clean_start`, `properties` arguments. Contributed by [Marcin Jaworski (@yawor)](https://github.com/yawor) in [#56](https://github.com/sbtinstruments/asyncio-mqtt/pull/56)
  • Fix Python 3.6 compatibility. Contributed by [(@fipwmaqzufheoxq92ebc)](https://github.com/fipwmaqzufheoxq92ebc) in [#57](https://github.com/sbtinstruments/asyncio-mqtt/pull/57).
  • Fix "Broken pipe" error. Contributed by [Gilbert (@gilbertsmink)](https://github.com/gilbertsmink) in [#55](https://github.com/sbtinstruments/asyncio-mqtt/pull/55)
  • Fix socket check when you select the WebSocket transport. Contributed by [Robert Chmielowiec (@chmielowiec)](https://github.com/chmielowiec) in [#54](https://github.com/sbtinstruments/asyncio-mqtt/pull/54)
  • Fix `TypeError` on invalid username and password combination
  • Check that _misc_task is not None before trying to cancel it. Contributed by [Ellis Percival (@flyte)](https://github.com/flyte) in [#41](https://github.com/sbtinstruments/asyncio-mqtt/pull/41)
  • Fix exception in `on_socket_open`: Non-thread-safe operation invoked on an event loop other than the current one. Contributed by [Ellis Percival (@flyte)](https://github.com/flyte) in [#40](https://github.com/sbtinstruments/asyncio-mqtt/pull/40)
v0.8.1
frederikaalundfrederikaalund·5y ago·February 23, 2021
GitHub

📋 Changes

  • Fix `AttributeError` when you use WebSockets.
  • Fix `asyncio.InvalidStateError` in the `_on_connect` callback.
  • Fix "Future exception was never retrieved" on disconnect.
  • Fix `connect` so it no longer blocks the event loop.
v0.8.0
frederikaalundfrederikaalund·5y ago·November 9, 2020
GitHub

Added

  • Add `transport` argument to `Client`
  • Contributed by [@opengs](https://github.com/opengs) in [#21](https://github.com/sbtinstruments/asyncio-mqtt/pull/21)
  • Add `clean_session` argument to `Client`
  • Contributed by [@nadyka](https://github.com/madnadyka) in [#17](https://github.com/sbtinstruments/asyncio-mqtt/pull/17)
v0.7.0
frederikaalundfrederikaalund·5y ago·August 4, 2020
GitHub

Added

  • Add support for MQTTv5.
  • Add `will` keyword argument to `Client`.
  • Add `MqttConnectError` with specific error messages for connection failures.
  • Add `Client.id` property that returns the client ID (or `None` if the client ID was not specified during construction).

🐛 Fixed

  • Fix unhandled exception error.
  • Fix "Task was destroyed but it is pending" error.
  • Fix compatibility with `asyncqt`'s event loop.
  • Fix race condition in `Client.connect` that raised an `AttributeError`.
  • Fix "[asyncio] Future exception was never retrieved" debug message.
  • Fix support for python 3.6. Contributed by [Derrick Lyndon Pallas (@pallas)](https://github.com/pallas) in [#12](https://github.com/sbtinstruments/asyncio-mqtt/pull/12)