From f3f298bbe695017a806efb6753cce2225207fbad Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Thu, 23 Jan 2020 13:55:23 -0800 Subject: [PATCH] handle the case where we might not be getting data for a while --- enphase.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/enphase.py b/enphase.py index f859847..e5a4eef 100644 --- a/enphase.py +++ b/enphase.py @@ -91,6 +91,9 @@ def thread_production(): e = time.time() if s > e: time.sleep(s - time.time()) + else: + # catch up s to e: + s += ((e - s) // 10) * 10 def thread_inventory(): global doexit