From 395219ff139d9787f6d6847c983c17ae4f6d83de Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Fri, 29 Dec 2023 18:05:38 +0800 Subject: [PATCH] update --- test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test.py b/test.py index 8dac5b9..631eece 100644 --- a/test.py +++ b/test.py @@ -1,5 +1,6 @@ import asyncio import json +import time import uvicorn from fastapi import FastAPI @@ -22,12 +23,14 @@ class MQTTClient: def push(self): self.client.publish(self.topic, payload=json.dumps({"msg": "open_led"}, ensure_ascii=False), qos=0) + time.sleep(5) self.client.publish(self.topic, payload=json.dumps({"msg": "push_stream"}, ensure_ascii=False), qos=0) def close(self): self.client.publish(self.topic, payload=json.dumps({"msg": "close_stream"}, ensure_ascii=False), qos=0) + time.sleep(5) self.client.publish(self.topic, payload=json.dumps({"msg": "close_led"}, ensure_ascii=False), qos=0)