This commit is contained in:
2026-02-25 11:20:20 +00:00
parent 46c99f1ae0
commit 0d69fcc296

View File

@@ -47,16 +47,19 @@ def update():
if data is not None and data["noshutdown"] == 1:
exit
now = to_seconds(datetime.now().time())
if (time - now) < 0:
exit
if (time == LAST_VALUE):
print("Nothing changed")
return
if (time != LAST_VALUE):
if (LAST_VALUE != 0):
subprocess.run(["shutdown", "/a"])
print("new val detected")
LAST_VALUE = time
if (time == LAST_VALUE):
print("Nothing changed")
return
print("shutting down in " + str(time - now) + " seconds")
# subprocess.run(["shutdown", "/s", "/t", (time - now), " "])
print(time - now)