scolby33 / weather_kindle

Use your Kindle to display a weather forecast!
Other
30 stars 4 forks source link

Name of the day of the week shift #4

Closed vladime closed 3 years ago

vladime commented 3 years ago

When weather information update and Cron job is executed for the first time week day are displayed correct. However with an update iteration (every hour) name of a week day shifts by one: Monday becomes Tuesday. Date and time on the Kindle is correct. This issue is spotted with AccuWeather and WMO options. IMG_6278

scolby33 commented 3 years ago

This is expected, depending on the forecast data source. Here's a snippet from the current data from the WMO for Munich at 14:11 UTC:

    "forecast": {
      "issueDate": "2021-03-15 10:00:00",
      "timeZone": "Local",
      "forecastDay": [
        {
          "forecastDate": "2021-03-16",
          "wxdesc": "",
          "weather": "Light Snow",
          "minTemp": "0",
          "maxTemp": "5",
          "minTempF": "32",
          "maxTempF": "41",
          "weatherIcon": 701
        },
        ...more days...

They switch over to showing "tomorrow" at some point during the day. It seems that the WMO swaps early in the day, whereas I've noticed the US NWS switches sometime in the mid-evening.

My current view of the data from AccuWeather still has Monday's forecast first, so there might be an issue here.

  "DailyForecasts": [
    {
      "Date": "2021-03-15T07:00:00+01:00",
      "EpochDate": 1615788000,
      "Temperature": {
        "Minimum": {
          "Value": 31,
          "Unit": "F",
          "UnitType": 18
        },
        "Maximum": {
          "Value": 40,
          "Unit": "F",
          "UnitType": 18
        }
      },
      "Day": {
        "Icon": 12,
        "IconPhrase": "Showers",
        "HasPrecipitation": true,
        "PrecipitationType": "Rain",
        "PrecipitationIntensity": "Light"
      },
      "Night": {
        "Icon": 12,
        "IconPhrase": "Showers",
        "HasPrecipitation": true,
        "PrecipitationType": "Rain",
        "PrecipitationIntensity": "Light"
      },
      "Sources": [
        "AccuWeather"
      ],
      "MobileLink": "http://m.accuweather.com/en/de/munich/80331/daily-weather-forecast/178086?day=1&lang=en-us",
      "Link": "http://www.accuweather.com/en/de/munich/80331/daily-weather-forecast/178086?day=1&lang=en-us"
    },
    ...more days...

I'll look in to my parsing of the AccuWeather API, but do you recall when you noticed this with them? If it was later in the day than 10:00, it could be the same cause, and it just doesn't show up so early in the day.

scolby33 commented 3 years ago

I've confirmed a bug in the AccuWeather parsing. Here's a build to test this (note that this doesn't have the WMO fix code from #2). Update_weather_k4_accuweather_date_fix.zip

vladime commented 3 years ago

Just tested Update_weather_k4_accuweather_date_fix.zip. Now everything is correct - today's day has right name. Thank you for repairing it!