update
This commit is contained in:
parent
672743e531
commit
9cbaef07f4
10
test.py
10
test.py
|
@ -77,25 +77,17 @@ async def startup(username, device):
|
||||||
|
|
||||||
def push_stream(username, device):
|
def push_stream(username, device):
|
||||||
MQTT = MQTTClient(broker, port, device, username, username)
|
MQTT = MQTTClient(broker, port, device, username, username)
|
||||||
try:
|
|
||||||
MQTT.start()
|
MQTT.start()
|
||||||
MQTT.push()
|
MQTT.push()
|
||||||
except Exception as e:
|
|
||||||
# print(e)
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def close_stream(username, device):
|
def close_stream(username, device):
|
||||||
try:
|
|
||||||
MQTT = MQTTClient(broker, port, device, username, username)
|
MQTT = MQTTClient(broker, port, device, username, username)
|
||||||
MQTT.start()
|
MQTT.start()
|
||||||
MQTT.close()
|
MQTT.close()
|
||||||
except Exception as e:
|
|
||||||
# print(e)
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
broker = 'mqtt.lihaink.cn'
|
broker = 'mqtt.lihaink.cn'
|
||||||
port = 1883
|
port = 1883
|
||||||
uvicorn.run(app, host="127.0.0.1", port=8001)
|
uvicorn.run(app, host="127.0.0.1", port=8000)
|
||||||
|
|
Loading…
Reference in New Issue