-
Notifications
You must be signed in to change notification settings - Fork 139
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 the MQTT Writer Block #930
base: main
Are you sure you want to change the base?
Conversation
) -> BlockResult: | ||
client = mqtt.Client() | ||
try: | ||
client.connect(host, port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
open -> send -> close pattern seems sus regarding performance
Isn't that possible to have con opened through the lifecycle of class?
return {"status": "Message published successfully"} | ||
except Exception as e: | ||
logging.error(f"Failed to publish message: {e}") | ||
return {"status": f"Failed to publish message: {e}"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing of such error status is impossible programatically - please change into bool statuses
"version": "v1", | ||
"short_description": "Publishes messages to an MQTT broker.", | ||
"long_description": "This block allows publishing messages to a specified MQTT broker and topic.", | ||
"license": "Apache-2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked that this block is supposed to be under Apache? Please clarify before moving forward.
Description
Added the MQTT Writer block. This block enables users to publish messages to an MQTT broker through Workflows.
Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
Any specific deployment considerations
Added the
paho-mqtt
library.Docs
N/A