jclarke0000 / MMM-OpenWeatherForecast

Magic Mirror weather module using OpenWeather API
44 stars 26 forks source link

weather alerts shown multiple times? #8

Open 0m4r opened 3 years ago

0m4r commented 3 years ago

For some reason, some of the weather alerts are shown twice. I cannot tell tho if they come twice from the BE service used to display them.

image

Robiv8 commented 2 years ago

yes, i have the same problem. Is there a solution?

RucknCover commented 2 years ago

I don't think it's a bug, I think it's returning all the items in the alerts node in the api call. If there is more than one being returned by the API, then it'll display them both. It looks like an array, you could check the various tags associated with the call (described here: https://openweathermap.org/api/one-call-api) and determine which ones you want to display.

marcx28 commented 1 year ago

I have the same problem

weather

This happens because the OpenWeather API returns two weather alerts. This first alert lasts from 13th December 00:00 to 13th December 23:59 and the second one from 14th December 00:00 to 14th December 23:59. They are basically the same but they return a new alert for each day.

api_response

I don't know a good solution to solve this problem