This commit is contained in:
xyj 2023-12-04 13:46:37 +08:00
parent 66027be2b6
commit fbeb89f71f
2 changed files with 3 additions and 4 deletions

View File

@ -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:

View File

@ -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)
}