Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accumulation #25

Open
ykuzmycz opened this issue Feb 8, 2023 · 0 comments
Open

Accumulation #25

ykuzmycz opened this issue Feb 8, 2023 · 0 comments

Comments

@ykuzmycz
Copy link

ykuzmycz commented Feb 8, 2023

I'm curious if I'm missing something or config is incorrect. Daily rain should show precipitation and percentage. Oddly I'm only seeing % and not number of mm of rain.

fItem.precipitation = this.formatPrecipitation(fData.pop, fData.rain ? fData.rain["1h"] : null, fData.snow ? fData.snow["1h"] : null);

formatPrecipitation: function(percentChance, rainAccumulation, snowAccumulation) {

var accumulation = null;

//accumulation
if (!this.config.concise && (rainAccumulation || snowAccumulation) ) {
  if (rainAccumulation){ //rain
    accumulation = (Math.round(rainAccumulation * 10) / 10) + " " + this.getUnit("accumulationRain");
  } else if (snowAccumulation) { //snow
    accumulation = Math.round(snowAccumulation) + " " + this.getUnit("accumulationSnow");
  } 
}

return {
  pop: percentChance ? Math.round(percentChance * 100) + "%" : "0%",
  accumulation: accumulation
};

I'm seeing in the json returned:
"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"pop":0.9,"rain":{"1h":0.1}},{"dt":1675983600,

Means that I should see 90% chance of rain with 1mm of rain. Oddly nothing shows up for the amount of rain.

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

No branches or pull requests

1 participant