Coder Social home page Coder Social logo

No daily weather about eink-calendar HOT 2 OPEN

kairapl avatar kairapl commented on May 29, 2024
No daily weather

from eink-calendar.

Comments (2)

zli117 avatar zli117 commented on May 29, 2024

How did you generate the API keys

from eink-calendar.

mav555555 avatar mav555555 commented on May 29, 2024

I encountered and worked this out myself...
OpenWeatherMap have implemented restrictions on the API calls which are possible at the free tier, so the current day data returns and can be displayed, but the daily forecast data is where the API key error comes from. If your API key predates the change, however, you still get that daily forecast - it only affects new free tier users.
The daily and forecast is bundled into the same calls in the v2 pyowm library (I think), but there is a workaround for it in the more recent v3 - but there are lots of other changes at the same time, so a bunch of stuff needs to be changed: https://pyowm.readthedocs.io/en/latest/v3/code-recipes.html
...Using the new functionality, one can use the OneCall to gather both the current day's data and the forecast. To swap that out changes are needed in the model/weather.py to change to, for example:
one_call.forecast_daily[i].weather_code ...for the weather code.
get_reference_time() converts to... one_call.current.reference_time(timeformat='date').date()

Two big changes though, is an additional step to use 'weather_manager()', and OneCall can only be called using lat and lon, rather than the city ID

Providing a full breakdown of the needed code changes is beyond my skills, though I did manage to fuss about and make it work for me. So I hope the above helps!

from eink-calendar.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.