From 27e96917469820a0aa0cda67ded41fce7eff2743 Mon Sep 17 00:00:00 2001 From: Kurt Huwig Date: Thu, 5 Sep 2019 13:55:38 +0200 Subject: [PATCH] Obey a_maximum_sleep config value Previously the value was ignored and 1024 seconds used. Now the value of a_maximum_sleep is used instead. --- apiscraper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apiscraper.py b/apiscraper.py index a913cd5..7742776 100644 --- a/apiscraper.py +++ b/apiscraper.py @@ -307,8 +307,10 @@ def check_states(self, interval): if interval > 1: interval /= 2 else: # there haven't been any changes, increase interval to allow the car to fall asleep - if interval < 2048: + if interval < a_maximum_sleep: interval *= 2 + else: + interval = a_maximum_sleep return interval