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 the MQTT Writer Block #930

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Added the MQTT Writer Block #930

wants to merge 9 commits into from

Conversation

chandlersupple
Copy link
Contributor

@chandlersupple chandlersupple commented Jan 9, 2025

Description

Added the MQTT Writer block. This block enables users to publish messages to an MQTT broker through Workflows.
image

Type of change

  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

  • Tested with a local MQTT broker
  • Passed all Inference tests
image

Any specific deployment considerations

Added the paho-mqtt library.

Docs

N/A

) -> BlockResult:
client = mqtt.Client()
try:
client.connect(host, port)
Copy link
Collaborator

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}"}
Copy link
Collaborator

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",
Copy link
Collaborator

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.

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.

2 participants