This commit is contained in:
Patrice 2019-06-06 19:31:53 +02:00
parent a7dc32b970
commit 03742d25cf
1 changed files with 11 additions and 10 deletions

View File

@ -47,17 +47,18 @@ def gen(camera):
######### ########### ######### ###########
def main(): def main():
for cam in cams: while True:
t = 1 # seconds a person can leave the room for for cam in cams:
t0 = time.time() t = 1 # seconds a person can leave the room for
time.clock() t0 = time.time()
elapsed = 0 time.clock()
stream = cam["ip"] elapsed = 0
detector = dt.Detector(stream) stream = cam["ip"]
music_playing = client_ip = clients[cam["client_id"]]["status"] detector = dt.Detector(stream)
client_ip = "http://" + clients[cam["client_id"]]["ip"] music_playing = client_ip = clients[cam["client_id"]]["status"]
client_ip = "http://" + clients[cam["client_id"]]["ip"]
while True:
elapsed = time.time() - t0 elapsed = time.time() - t0
if elapsed > t and music_playing: if elapsed > t and music_playing:
r = requests.get(client_ip + "/stop") r = requests.get(client_ip + "/stop")