From 61c5be1a084815cb7ce79970a5d93b39145f4106 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 5 Dec 2024 11:39:36 -0800 Subject: [PATCH] throttleEAS --- modules/system.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/system.py b/modules/system.py index f35a87b..7989d18 100644 --- a/modules/system.py +++ b/modules/system.py @@ -642,9 +642,12 @@ def handleMultiPing(nodeID=0, deviceID=1): def handleWxBroadcast(deviceID=1): - # only allow API call every 15 minutes + # only allow API call every 20 minutes + # the watchdog will call this function 3 times, seeing possible throttling on the API clock = datetime.now() - if clock.minute % 20 == 0: + if clock.minute % 20 != 0: + return False + if clock.second > 17: return False # check for alerts