2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-21 09:02:07 +00:00

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.
This commit is contained in:
Jarrod Johnson 2024-11-11 13:48:21 -05:00
parent d8c633a7d5
commit b1f8cf8f12

View File

@ -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()