From b000454b1767937597bf25e4437a2b46868e7f87 Mon Sep 17 00:00:00 2001 From: Michael Meli Date: Fri, 6 Jan 2023 15:31:06 -0500 Subject: [PATCH] fix incorrect calculation on timeout give up count --- setup.cfg | 2 +- src/pyduke_energy/const.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index b25ba47..96cb006 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pyduke-energy -version = 1.0.4 +version = 1.0.5 author = Michael Meli author_email = mjmeli94@gmail.com description = Python Wrapper for unofficial Duke Energy REST API diff --git a/src/pyduke_energy/const.py b/src/pyduke_energy/const.py index 05d89ca..ef4079c 100644 --- a/src/pyduke_energy/const.py +++ b/src/pyduke_energy/const.py @@ -36,7 +36,7 @@ MESSAGE_TIMEOUT_RETRY_COUNT = 3 # number of times a message timeout can occur before we totally give up (allow 2 fastpolls) -MESSAGE_TIMEOUT_GIVE_UP_COUNT = ((FASTPOLL_TIMEOUT_MIN * 60) / MESSAGE_TIMEOUT_SEC) + 1 +MESSAGE_TIMEOUT_GIVE_UP_COUNT = 2 * FASTPOLL_TIMEOUT_MIN * 60 / MESSAGE_TIMEOUT_SEC # in minutes, minimum amount of time to wait before retrying connection on forever loop FOREVER_RETRY_MIN_MINUTES = 1