Check for file before trying to read it.

master
jowj 4 years ago
parent 2793db07fd
commit 1d02b3102b

@ -91,7 +91,10 @@ while is_on:
# track state
file = open("/shared/results.json", "r")
stateFile = open("/shared/state.log", "r")
if os.path.exists("/shared/state.log"):
stateFile = open("/shared/state.log", "r")
else:
stateFile = open("/shared/state.log", "w+")
oldData = stateFile.read()
if oldData != file.read():

Loading…
Cancel
Save