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

Setting the client name within Flask is invalid #158

Open
gdushang opened this issue Dec 15, 2023 · 0 comments
Open

Setting the client name within Flask is invalid #158

gdushang opened this issue Dec 15, 2023 · 0 comments

Comments

@gdushang
Copy link

if set client name in flask config,using Mqtt.init_app to init app, client name of mqtt will be set to the default value,

In init_ App () should be corrected to first obtain the config of Flask, and then set up monitoring self. client_ ID,

    if "MQTT_CLIENT_ID" in app.config:
        self.client_id = app.config["MQTT_CLIENT_ID"]
    if isinstance(self.client_id, unicode):
        self.client._client_id = self.client_id.encode("utf-8")
    else:
        self.client._client_id = self.client_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant