Skip to content

NWS returning stale data #50

@fancygaphtrn

Description

@fancygaphtrn

I use the NWS component in Home Assistant and it depends on the lib.

This week I am getting stale data returned from the NWS. All week it returns the forecast starting on Monday.

If I would open the url via my browser it would get current data.

I did some experimenting via curl and is seems to be an issues with the Accept header.

This returns stale data.
curl -i -H "Accept: application/geo+json" -H "User-Agent: pynws {xxx@xxx.com}" https://api.weather.gov/gridpoints/RNK/49,40/forecast

"periods": [ { "number": 1, "name": "This Afternoon", "startTime": "2020-07-27T13:00:00-04:00", "endTime": "2020-07-27T18:00:00-04:00", "isDaytime": true,

This return current data
curl -i -H "Accept: /" -H "User-Agent: pynws {xxx@xxx.com}" https://api.weather.gov/gridpoints/RNK/49,40/forecast

"periods": [ { "number": 1, "name": "Today", "startTime": "2020-07-30T11:00:00-04:00", "endTime": "2020-07-30T18:00:00-04:00", "isDaytime": true,
As a work around for me I changed the Accept in const.py to /

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions