Skip to content

Commit

Permalink
correction on init_app()
Browse files Browse the repository at this point in the history
`Mqtt.init_app(self, app: Flask, ···)` now assigns `app` to `self.app` if this one is None.
  • Loading branch information
pg-goose authored Jan 25, 2023
1 parent f0af5c5 commit f889437
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flask_mqtt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def __init__(
def init_app(self, app: Flask, config_prefix : str = "MQTT") -> None:
"""Init the Flask-MQTT addon."""

if self.app is None:
self.app = app

if config_prefix + "_CLIENT_ID" in app.config:
self.client_id = app.config["MQTT_CLIENT_ID"]

Expand Down

0 comments on commit f889437

Please sign in to comment.