Browse Source

handle when requests fail...

main
John-Mark Gurney 4 years ago
parent
commit
c81c3fc896
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      enphase.py

+ 6
- 2
enphase.py View File

@@ -128,9 +128,13 @@ def thread_panels():
#reps.sort() #reps.sort()
#print '\n'.join(time.ctime(x) for x in reps) #print '\n'.join(time.ctime(x) for x in reps)


lastrepdate = max(x['lastReportDate'] for x in r)
try:
lastrepdate = max(x['lastReportDate'] for x in r)

waittotime = lastrepdate + 300 + 10
except ValueError:
waittotime = 0


waittotime = lastrepdate + 300 + 10
curtime = time.time() curtime = time.time()


if waittotime < curtime: if waittotime < curtime:


Loading…
Cancel
Save