Format a multi key-value MQTT message in Python

Here's the code to formulate a multi-attribute (multi key-value) MQTT message in Python

mqtt_message = "{\"value\":\"" + str(light) + "\",\"serialNumber\":\"" + str(loopCount) + "\",\"sensorType\":\"light\"}"

Comments

Popular posts from this blog

How to create an organizational chart in your webpage using Google Organization Chart Tools

Embed JSX code with if condition in React app