Skip to content

mqtt event source seems to be using deprecated connection methods #3

Closed
@jpmens

Description

@jpmens

I ran pip install aiomqtt and got aiomqtt-1.2.1 installed which, when used from the mqtt event source reports:

2023-10-01 09:42:51,286 - mqtt - WARNING - The manual `connect` and `disconnect` methods are deprecated and will be removed in a future version. The preferred way to connect and disconnect the client is to use the context manager interface via `async with`. In case your use case needs to connect and disconnect manually, you can call the context manager's `__aenter__` and `__aexit__` methods as an escape hatch instead. `__aenter__` is equivalent to `connect`. `__aexit__` is equivalent to `disconnect` except that it forces disconnection instead of throwing an exception in case the client cannot disconnect cleanly. `__aexit__` expects three arguments: `exc_type`, `exc`, and `tb`. These arguments describe the exception that caused the context manager to exit, if any. You can pass `None` to all of these arguments in a manual call to `__aexit__`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions