diff --git a/application/luniebox.py b/application/luniebox.py index 8f92a65..b48a53e 100644 --- a/application/luniebox.py +++ b/application/luniebox.py @@ -130,6 +130,7 @@ class Luniebox(object): if restart: subprocess.run(["sudo", "systemctl", "restart", "spotifyd"]) + time.sleep(20) tries = 0 spotifyd_status = subprocess.call( @@ -137,7 +138,7 @@ class Luniebox(object): while spotifyd_status != 0 and tries < max_tries: subprocess.call(["systemctl", "restart", "spotifyd"]) - tries += 1 + tries = tries + 1 time.sleep(10 * tries) spotifyd_status = subprocess.call( ["systemctl", "is-active", "--quiet", "spotifyd"])