From d80600863a0d5e1639d69bcdf395d91705188a65 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sun, 16 Aug 2026 19:21:03 +0200 Subject: [PATCH] timezone --- .gitea/workflows/release.yml | 27 +++++---------------------- src/main.cpp | 13 +++++++------ 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 6db90c2..fc1f000 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -20,26 +20,9 @@ jobs: - name: Build firmware run: pio run - - name: Upload firmware.bin to release + - name: Create Release and Upload Firmware + uses: softprops/action-gh-release@v2 + with: + files: .pio/build/esp32dev/firmware.bin env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - run: | - set -e - API="http://192.168.0.37:3000/api/v1/repos/rasmus/flyradar" - TAG="${GITHUB_REF_NAME}" - echo "Fetching release for tag $TAG ..." - RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" \ - "$API/releases/tags/$TAG") - RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r '.id') - if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then - echo "Error: could not find release for tag $TAG" - echo "Response: $RELEASE_JSON" - exit 1 - fi - echo "Uploading to release ID $RELEASE_ID ..." - curl -s -H "Authorization: token $GITEA_TOKEN" \ - -H "Content-Type: application/octet-stream" \ - --data-binary @.pio/build/esp32dev/firmware.bin \ - "$API/releases/$RELEASE_ID/assets?name=firmware.bin" - echo "" - echo "Upload complete." \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 5a6343b..4e8592c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -626,12 +626,13 @@ void setup() { } SplashScreen::setStatusLine(tft, 2, I18n::t(StringId::SPLASH_READY)); -// Once IP geolocation has provided a UTC offset, set the - // timezone accordingly - timestamps (flight log, log file names) - // then show the REAL local time instead of UTC, automatically correct worldwide. - if (LocationManager::hasUtcOffset()) { - configTime(LocationManager::utcOffsetSeconds(), 0, "pool.ntp.org", "time.nist.gov"); - } +// Sync time via NTP (UTC), then set timezone to Central European + // Time (Copenhagen) with automatic DST handling (CET/CEST). + // This makes localtime_r() return the correct local time year-round + // regardless of when the device was booted. + configTime(0, 0, "pool.ntp.org", "time.nist.gov"); + setenv("TZ", "CET-1CEST-2,M3.5.0/2,M10.5.0/3", 1); + tzset(); AircraftTable::init(); AirlineLookup::init();