a
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user