naofireblade / homebridge-weather-plus

A comprehensive weather plugin for homebridge.
MIT License
314 stars 63 forks source link

Issue with openweathermap-apis #53

Closed simont77 closed 5 years ago

simont77 commented 5 years ago

Hi, I found an issue with the openweathermap api module that you are using. Actually, if network is not up when weather update is requested, an unhandled exception is thrown by the http module and homebridge crashes. The issue has been reported to the developer of openweathermap-apis, but apparently it is not developed anymore https://github.com/CICCIOSGAMINO/openweather-apis/issues/23 Did you try other openweathermap API? I tried to catch the exception in homebridge-Weather-plus but since it is an async exception it seems to be possible to catch it only directly in the calling function.

naofireblade commented 5 years ago

Hey, no i didn't try another openweather API. The current openweather capability was integrated as a PR some time ago: #36 Fell free to change that if you found a better one :) .

simont77 commented 5 years ago

This API seems to be the most functional. I posted a PR with the fix. Let's see if the original author is still active, otherwise we can fork the API and include it directly into homebridge-weather-plus, or set a dependency over my forked git repository.

naofireblade commented 5 years ago

His last action is from january so I think the chances are good. Otherwise I think you forked project as a depedency would be the best option, so that other projects can benefit from your fix as well.

simont77 commented 5 years ago

He just merged the PR and issue version 4.0.0! So you have to update package.json with the new dependency version

simont77 commented 5 years ago

Don't forget to update also the dependency on operweather-apis. :wink:

naofireblade commented 5 years ago

Done, thanks for the heads up :)