Skip to content

Conversation

@count023
Copy link
Contributor

@count023 count023 commented Nov 20, 2016

Hi Squix78,

it's about the WundergroundClient again ;)

I added a second method updateConditions with a different signature to be able to use these ZMW-Codes Wunderground lately uses.
I also provide an example Sketch "WundergroundClientPlainDemo.ino" which simply uses the WundergroundClient and uses most of the public methods.

By the way: i didn't find out, how to use this methods appropriately:

  • String getForecastIcon(int period);
  • String getForecastTitle(int period);
  • String getForecastLowTemp(int period);
  • String getForecastHighTemp(int period);
    because i can't figure out, how to retrieve the "period".
    Why not adding a getter for the private field "currentForecastPeriod" or also providing the forecast getters without any parameters?

Beyond that i had some problems with getCurrentEpoch(). It seems to lead to a out-of-bound write in certain circumstances and crashed my esp8266. I will try to reproduce as soon as possible. Maybe the long is not long enough? ;)

But besides this, i would be very glad, You accepting my pull request again ;)

Yours,
Count023

@squix78 squix78 merged commit 56a9c24 into ThingPulse:master Nov 24, 2016
@squix78
Copy link
Collaborator

squix78 commented Nov 24, 2016

Hi Count023

Thanks a lot for your code! Looks really good!
About the period thing; I'm not quite sure if I understand your question, so forgive me if I answer something you already know. If you look at the response json object form the forecast resource you can see an array of objects, all of them having a period attribute like this:
{
"period": 1,
"icon": "partlycloudy",
"icon_url": "http://icons-ak.wxug.com/i/c/k/partlycloudy.gif",
"title": "Tuesday Night",
"fcttext": "Mostly cloudy. Fog overnight. Low of 50F. Winds from the WSW at 5 to 15 mph.",
"fcttext_metric": "Mostly cloudy. Fog overnight. Low of 10C. Breezy. Winds from the WSW at 10 to 20 km/h.",
"pop": "0"
}
So for this object the method getForecastIcon(1) would return "partlycloudy"...

Does that answer your question?

@count023
Copy link
Contributor Author

Hi Squix78!

Thank you for accepting!
And sorry for not reacting in time, the pre-christmas time had its challenges...

About the period thing: no, you didn't tell me something i already knew but rather enlightened me in this case 😆 Thank you as well for this!
I will meditate about it and maybe give this detail in the example sketch an try...

Yours,
Count023

@count023 count023 deleted the wunderground-url-scheme-change branch December 30, 2016 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants