def on_connect(client, userdata, flags, rc):
print("Connected to the {0} topic".
format(topic))
subscribe_result = client.subscribe(topic)
publish_result_1 = client.publish(
topic=topic,
payload="Listening to messages in the Paho Python Client")
publish_result_2 = publish_command(
client,
topic,
"print_temperature_fahrenheit",
"temperature_fahrenheit",
45)
publish_result_3 = publish_command(
client,
topic,
"print_information_message",
"text",
"Python IoT")
iot_python_chapter_09_06.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录