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 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: class MQTT:
@ -29,6 +29,8 @@ class MQTT:
# git更新项目和配置文件 # git更新项目和配置文件
update() update()
client.publish('success', payload='update success', qos=0) client.publish('success', payload='update success', qos=0)
elif data == "record_list":
get_list_record()
elif data == "record": elif data == "record":
get_record(msg, self.client) get_record(msg, self.client)
else: else:

View File

@ -1,10 +1,8 @@
import datetime
import json import json
import os import os
import subprocess import subprocess
import requests import requests
from fastapi import FastAPI
mp4_path = '/home/pi/mp4' mp4_path = '/home/pi/mp4'
@ -29,7 +27,6 @@ def update():
def get_list_record(): def get_list_record():
print(os.listdir(mp4_path))
data = { data = {
"data": os.listdir(mp4_path) "data": os.listdir(mp4_path)
} }