v.0.8.3 main.py print_time_task on display
This commit is contained in:
12
main.py
12
main.py
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user