Giter Club home page Giter Club logo

Comments (6)

dacarson avatar dacarson commented on August 16, 2024 2

Fixed and landed in #276

from homebridge-weather-plus.

dacarson avatar dacarson commented on August 16, 2024

Looking at the code, without reproducing it myself, this does definitely look like a bug.

In the update(forecastDays, callback) function in openweathermap.js, it tries to fetch the current forecast with the 2.5 API:

// Old api requires an extra call to get the forecast
if (this.api === "2.5")
{
	this.getWeatherData(this.apiBaseURL + "/data/2.5/forecast", (error, result) =>
	{
		this.generateForecasts(weather, result["list"], result["city"]["timezone"], callback);
	});
}

In the function getWeatherData(), if there is a requestError it calls the callback with a null result object, aka callback(requestError);

Then when it tries to process the response:
this.generateForecasts(weather, result["list"], result["city"]["timezone"], callback);
it does not take into account that an error may have occurred and the result object is null.

from homebridge-weather-plus.

dacarson avatar dacarson commented on August 16, 2024

I have a fix that would handle this error gracefully, aka log it and move on.
Can I send you an updated openweathermap.js file to test?

from homebridge-weather-plus.

gsampieri avatar gsampieri commented on August 16, 2024

Hello,
I have the same issue that occasionally occurs on version 3.2.11.
I would appreciate the update of the openweathermap.js file to test !
Thank you!

from homebridge-weather-plus.

dacarson avatar dacarson commented on August 16, 2024

Are we able to close this now?

from homebridge-weather-plus.

zanethefox avatar zanethefox commented on August 16, 2024

Hello thanks so much for the work! I missed the notifications unfortunately. Yes, we can close this now, thanks again!

from homebridge-weather-plus.

Related Issues (20)

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.