提交 f060f674 authored 作者: 郑晓兵's avatar 郑晓兵

市民中心

上级 002f0137
# -*- coding: utf-8 -*-
# cython: language_level=3
"""
* User: ZXB
* Date: 2020/4/10
* Time: 11:14
* Project: 与API fox 对接
"""
api_token = 'APS-RHzgEBM63lspSx4JgpUX27y6bppQq4UC'
project_id = '2898960'
# -*- coding: utf-8 -*-
# cython: language_level=3
import json
import paho.mqtt.client as mqtt
# 创建MQTT客户端
client = mqtt.Client(protocol=mqtt.MQTTv311)
# 连接服务器
broker_address = "139.159.185.67"
port = 1881
client.connect(broker_address, port)
# 发布消息
topic = "/maintain/room/master/client/"
message = {
"data": {
"roomBindData": {
"alias": "1111",
"appToken": "AND-HW-P1OK",
"cnum": "27981f71989f8ce04e0f74d577ce8b72",
"companyNumber": "CN-HW-V3LR",
"conferenceId": 108,
"conferenceNumber": "27981f71989f8ce04e0f74d577ce8b72",
"roomName": "C1120",
"serverUrl": "http://139.159.185.67:8998"
},
"attendants": {
"isCanSign": True,
"mid": "2024-0921052238733",
"name": "于治-普通用户2",
"uid": "122626"
}
},
"action": "attendantCloseAllDevices",
"device_udid": "ef43f26aead65ec1f230fdd5e5f5c367ee3f23306171f3cfdc9f97b90fe9b5f4"
}
client.publish(topic, json.dumps(message), qos=0)
# 断开连接
client.disconnect()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论