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

Added support for output to Mqtt broker #15

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

saemmy
Copy link
Contributor

@saemmy saemmy commented Mar 3, 2021

No description provided.

def send(self, vals):
client = mqtt.Client()
client.username_pw_set(username=self.mqtt_user, password=self.mqtt_pass)
client.connect(self.mqtt_host, self.mqtt_port, self.mqtt_keepalive)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think we would be better off connecting on class instantiation and keeping the connection open, rather than connecting & disconnecting each time we have a new set of outputs.

We will need to handle the case where the client is disconnected and attempt a reconnect, and also if we get another send request while the client is already attempting to connect.

@sumnerboy12
Copy link

Is this still likely to be merged at some point? This would be a great addition IMO.

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

Successfully merging this pull request may close these issues.

3 participants