From 00c24110ee2912b4f4e51cbfd4857787433d4e5d Mon Sep 17 00:00:00 2001 From: tiijay Date: Thu, 20 Nov 2025 12:42:05 +0000 Subject: [PATCH] v.0.10.1 restapi/mock --- pico-client/deploy.fish | 2 +- pico-client/main.py | 10 ++-------- pico-client/tryout/weather_checker.py | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/pico-client/deploy.fish b/pico-client/deploy.fish index a7ed07d..89065e1 100755 --- a/pico-client/deploy.fish +++ b/pico-client/deploy.fish @@ -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 : diff --git a/pico-client/main.py b/pico-client/main.py index d160c9c..4bf4d0c 100644 --- a/pico-client/main.py +++ b/pico-client/main.py @@ -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)) diff --git a/pico-client/tryout/weather_checker.py b/pico-client/tryout/weather_checker.py index 0260be6..e0533f0 100644 --- a/pico-client/tryout/weather_checker.py +++ b/pico-client/tryout/weather_checker.py @@ -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)