From fbeb89f71ffea1cc8da6e00a2f1dbce80e43ec50 Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Mon, 4 Dec 2023 13:46:37 +0800 Subject: [PATCH] test --- MQTT.py | 4 +++- tool.py | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/MQTT.py b/MQTT.py index d4f9577..d7c532e 100644 --- a/MQTT.py +++ b/MQTT.py @@ -2,7 +2,7 @@ import json import paho.mqtt.client as mqtt -from tool import push_stream, close_stream, update, exec_sh, get_record +from tool import push_stream, close_stream, update, exec_sh, get_record, get_list_record class MQTT: @@ -29,6 +29,8 @@ class MQTT: # git更新项目和配置文件 update() client.publish('success', payload='update success', qos=0) + elif data == "record_list": + get_list_record() elif data == "record": get_record(msg, self.client) else: diff --git a/tool.py b/tool.py index 840a887..63b6589 100644 --- a/tool.py +++ b/tool.py @@ -1,10 +1,8 @@ -import datetime import json import os import subprocess import requests -from fastapi import FastAPI mp4_path = '/home/pi/mp4' @@ -29,7 +27,6 @@ def update(): def get_list_record(): - print(os.listdir(mp4_path)) data = { "data": os.listdir(mp4_path) }