Double buffering and Force Clear

Attempting to clean up flicker - otherwise working
This commit is contained in:
Chuck
2025-04-07 21:31:26 -05:00
parent a5f91040f6
commit d49f901ffc
4 changed files with 32 additions and 19 deletions

View File

@@ -67,7 +67,7 @@ class Clock:
current_time = datetime.now(self.timezone)
return current_time.strftime(self.clock_config.get('format', '%H:%M:%S'))
def display_time(self) -> None:
def display_time(self, force_clear: bool = False) -> None:
"""Display the current time."""
current_time = self.get_current_time()
@@ -82,8 +82,7 @@ class Clock:
y = (self.display_manager.matrix.height - 24) // 2
logger.debug("Drawing time at position (%d, %d)", x, y)
self.display_manager.clear()
self.display_manager.draw_text(current_time, x, y)
self.display_manager.draw_text(current_time, x, y, force_clear=force_clear)
if __name__ == "__main__":
clock = Clock()