Skip to content

Json message #214

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

Merged
merged 4 commits into from
Jul 6, 2021
Merged

Json message #214

merged 4 commits into from
Jul 6, 2021

Conversation

sbSteveK
Copy link
Contributor

@sbSteveK sbSteveK commented Jul 6, 2021

Issue #, if available:

if the mqtt payload is a string the AWS MQTT test client shows a "Message cannot be displayed in specified format." warning.

Description of changes:

Changed the payload to json to prevent the aforementioned warning/error.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

sbSteveK added 3 commits July 6, 2021 15:08
… client shows a Message cannot be displayed in specified format. warning on strings
… client shows a Message cannot be displayed in specified format warning on strings
@@ -154,10 +155,11 @@ def on_message_received(topic, payload, dup, qos, retain, **kwargs):
publish_count = 1
while (publish_count <= args.count) or (args.count == 0):
message = "{} [{}]".format(args.message, publish_count)
print("Publishing message to topic '{}': {}".format(args.topic, message))
messageJson = json.dumps(message)
Copy link
Contributor

@TingDaoK TingDaoK Jul 6, 2021

Choose a reason for hiding this comment

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

Trivial: For python, we usually use snake case for variables.

@sbSteveK sbSteveK merged commit f107ecf into main Jul 6, 2021
@sbSteveK sbSteveK deleted the jsonMessage branch July 6, 2021 23:03
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