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,6 +47,7 @@ def gen(camera):
######### ########### ######### ###########
def main(): def main():
while True:
for cam in cams: for cam in cams:
t = 1 # seconds a person can leave the room for t = 1 # seconds a person can leave the room for
t0 = time.time() t0 = time.time()
@ -57,7 +58,7 @@ def main():
music_playing = client_ip = clients[cam["client_id"]]["status"] music_playing = client_ip = clients[cam["client_id"]]["status"]
client_ip = "http://" + clients[cam["client_id"]]["ip"] 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")