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