test
This commit is contained in:
parent
66027be2b6
commit
fbeb89f71f
4
MQTT.py
4
MQTT.py
|
@ -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:
|
||||||
|
|
3
tool.py
3
tool.py
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue