v.0.8.3 main.py print_time_task on display

This commit is contained in:
tiijay
2025-11-19 08:31:16 +00:00
parent c817f0330a
commit 2be6d888b3
3 changed files with 116 additions and 57 deletions

12
main.py
View File

@@ -7,7 +7,7 @@ from app.utils import (
get_datetime_string,
get_german_datetime,
) # Time-related functions
from app.utils import SimpleCounter
from app.utils import SimpleCounter, colors
import time
import uasyncio as asyncio # type: ignore
from app.web import Wlan
@@ -28,10 +28,16 @@ async def weather_check_task(weather_checker: Weather_Checker):
async def print_time_task() -> None:
simpleCnt: SimpleCounter = SimpleCounter()
while True:
dt1: int = get_datetime_string()
dt2: int = get_german_datetime()
dt1: str = get_datetime_string()
dt2: str = get_german_datetime()
simpleCnt += 1
print(f"print_time_task running... {simpleCnt.value % 16} {dt1} {dt2}")
bottom_ypos = display.MATRIX_HEIGHT - display.font_height
time_str: str = get_datetime_string("time")
display.clear_row(bottom_ypos)
display.write_text(time_str[:8], 0, bottom_ypos, color=colors.NEON_YELLOW)
await asyncio.sleep(10)