From b1f8cf8f12b62e712f98020be701dbe9759d4e32 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 11 Nov 2024 13:48:21 -0500 Subject: [PATCH] Avoid redrawing 'powered off' redundantly. If the power state stays the same between queries, take no action to clear screen and draw redundant data. In the case of misreporting devices, it mitigates the impact of incorrect reporting, while generally preserving the output behavior when accurate. --- confluent_client/bin/confetty | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index 0ce3cd5e..e1126df8 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -948,8 +948,9 @@ def main(): except IOError: pass if powerstate is None or powertime < time.time() - 10: # Check powerstate every 10 seconds + if powerstate == None: + powerstate = True powertime = time.time() - powerstate = True check_power_state() else: currcommand = prompt()