Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.0 #262

Merged
merged 9 commits into from
Jan 15, 2024
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We're very happy about contributions to aiomqtt! ✨
- Clone the aiomqtt repository
- Install the Python version noted in `.python-version` via `pyenv`
- Install poetry; Then run `./scripts/setup` to install the dependencies and aiomqtt itself
- Run ruff, and mypy with `./scripts/check`
- Run ruff and mypy with `./scripts/check`
- Run the tests with `./scripts/test`

During development, it's often useful to have a local MQTT broker running. You can spin up a local mosquitto broker with Docker via `./scripts/develop`. You can connect to this broker with `aiomqtt.Client("localhost", port=1883)`.
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ async with Client("test.mosquitto.org") as client:

```python
async with Client("test.mosquitto.org") as client:
async with client.messages() as messages:
await client.subscribe("humidity/#")
async for message in messages:
print(message.payload)
await client.subscribe("humidity/#")
async for message in client.messages:
print(message.payload)
```

aiomqtt combines the stability of the time-proven [paho-mqtt](https://github.com/eclipse/paho.mqtt.python) library with an idiomatic asyncio interface:
Expand Down
10 changes: 4 additions & 6 deletions aiomqtt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# SPDX-License-Identifier: BSD-3-Clause
from .client import (
Client,
Message,
ProtocolVersion,
ProxySettings,
TLSParameters,
Topic,
TopicLike,
Wildcard,
WildcardLike,
Will,
)
from .error import MqttCodeError, MqttError
from .exceptions import MqttCodeError, MqttError, MqttReentrantError
from .message import Message
from .topic import Topic, TopicLike, Wildcard, WildcardLike

__all__ = [
"__version__",
Expand All @@ -27,5 +24,6 @@
"WildcardLike",
"Will",
"MqttCodeError",
"MqttReentrantError",
"MqttError",
]
Loading
Loading