From 90874b929755033fd33165868f3316863bdabfd3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 4 Jan 2025 14:42:14 +0300 Subject: [PATCH] check bioeb interval changes after sleep --- src/autobioebbing.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/autobioebbing.py b/src/autobioebbing.py index 919d762..7db737d 100644 --- a/src/autobioebbing.py +++ b/src/autobioebbing.py @@ -295,8 +295,13 @@ async def eb(client, c, conn, con, d, get_id, my_id, message_q): f'bioeb sleep [increased, because avocado have lag]: {interval_with_lag}s') await asyncio.sleep(interval_with_lag) else: + current_bioeb_sleep_interval = states.auto_bioeb_sleep_interval logger.debug(f'bioeb sleep: {rs}s') await asyncio.sleep(rs) + if states.auto_bioeb_sleep_interval != current_bioeb_sleep_interval: + add_delay = states.auto_bioeb_sleep_interval[0] + random.uniform(0.2352, 2.24885) + logger.debug(f'bioeb sleep interval change detected +{add_delay}s sleep') + await asyncio.sleep(add_delay) if len(e_info) <= 0: count, e_info = get_some_patients() if count < 2: