This commit is contained in:
2026-02-25 11:51:28 +00:00
parent 0d69fcc296
commit 5ee126d0ec

View File

@@ -40,12 +40,14 @@ def to_seconds(t):
def update():
global LAST_VALUE
data = get_data()
if data is not None and data["noshutdown"] == 1:
if (LAST_VALUE != 0):
subprocess.run(["shutdown", "/a"])
exit
if data is None:
time = to_seconds(datetime.strptime(DEFAULT_SHUTDOWN, "%H:%M").time())
else:
time = to_seconds(datetime.strptime(data["time"], "%H:%M").time())
if data is not None and data["noshutdown"] == 1:
exit
now = to_seconds(datetime.now().time())
if (time - now) < 0: