Swap state logic so that true is only triggered on change

master
jowj 5 years ago
parent 5b31be5a26
commit 3384017e49

@ -25,10 +25,10 @@ while is_on:
# track state # track state
file = open("/shared/results.json", "r") file = open("/shared/results.json", "r")
oldData = file.read() oldData = file.read()
if oldData == json_string: if oldData != json_string:
stateChanged = False
else:
stateChanged = True stateChanged = True
else:
stateChanged = False
# old file removal must happen after state tracking: # old file removal must happen after state tracking:
os.remove("/shared/results.json") os.remove("/shared/results.json")

Loading…
Cancel
Save