v.0.10.1 restapi/mock

This commit is contained in:
tiijay
2025-11-20 12:42:05 +00:00
parent 76a8203458
commit 00c24110ee
3 changed files with 4 additions and 10 deletions

View File

@@ -12,7 +12,7 @@ mpremote connect port:rfc2217://localhost:4000 mkdir web
echo "1. Copying pico-client directories to device..."
mpremote connect port:rfc2217://localhost:4000 cp -r restapi/mock :
mpremote connect port:rfc2217://localhost:4000 cp -r restapi/mock :restapi
mpremote connect port:rfc2217://localhost:4000 cp -r classes :
mpremote connect port:rfc2217://localhost:4000 cp -r display :
mpremote connect port:rfc2217://localhost:4000 cp -r tryout :

View File

@@ -7,8 +7,7 @@ from utils import (
get_datetime_string,
get_german_datetime,
) # Time-related functions
from utils import SimpleCounter, colors
import time
from utils import SimpleCounter
from utils.digital_clock import DigitalClock
import uasyncio as asyncio # type: ignore
from web import Wlan
@@ -21,7 +20,7 @@ CITY_LIST: list[str] = sorted(
async def weather_check_task(weather_checker: Weather_Checker):
while True:
for city in CITY_LIST:
weather_checker.check(city=city, lang="de", test_mode=False)
weather_checker.check(city=city, lang="de", test_mode=True)
print(f"Checked {city}")
await asyncio.sleep(3 * 60) # Non-blocking sleep
@@ -68,10 +67,5 @@ if __name__ == "__main__":
display.set_font(font_5x7)
weather_checker: Weather_Checker = Weather_Checker(display=display)
# while True:
# for city in sorted(CITY_LIST):
# weather_checker.check(city=city, lang="de", test_mode=False)
# time.sleep(5*60)
# show_system_load()
asyncio.run(main(weather_checker))

View File

@@ -21,7 +21,7 @@ class Weather_Checker:
self.display = display
def mock_weather_data(self):
filepath = "restapi/mock-weather.json"
filepath = "restapi/mock/weather.json"
try:
with open(filepath, "r", encoding="utf-8") as file:
return json.load(file)