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)