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

weatherforecast rainfall rounding issue #1374

Closed
vincep5 opened this issue Aug 7, 2018 · 1 comment
Closed

weatherforecast rainfall rounding issue #1374

vincep5 opened this issue Aug 7, 2018 · 1 comment

Comments

@vincep5
Copy link
Contributor

vincep5 commented Aug 7, 2018

Please only submit reproducible issues.

If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: https://forum.magicmirror.builders/category/15/bug-hunt
Problems installing or configuring your MagicMirror? Check out: https://forum.magicmirror.builders/category/10/troubleshooting

When submitting a new issue, please supply the following information:

Platform: Place your platform here... give us your web browser/Electron version and your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX).
Raspberry Pi 3B

Node Version: Make sure it's version 0.12.13 or later.
v9.11.2

MagicMirror Version: Now that the versions have split, tell us if you are using the PHP version (v1) or the newer JavaScript version (v2).
v2.4.1

Description: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem.
weatherforecast is rounding rain before it converts it into imperial. So, if the real rainfall is 1.34 the code is turning that into "1" and then performing the calculation to imperial against 1 and not 1.34

Steps to Reproduce: List the step by step process to reproduce the issue.
setup your config to have units: "imperial" in the main config section.
setup your config to have showRainAmount:true in the weatherforecast module.

Expected Results: Describe what you expected to see.
Rainfall amounts should vary day to day.

Actual Results: Describe what you actually saw.
Often many days have the same rainfall amounts.

Configuration: What does the used config.js file look like? Don't forget to remove any sensitive information!
var config = {

units: "imperial",
}

..........

{
	module: "weatherforecast",
	position: "top_right",
	header: "Forecast",
	config: {
		updateInterval: 60 * 60 * 1000, // every 60 minutes
		showRainAmount: true,
		roundTemp: true,
		location: "hidden",
		locationID: "hidden",  //ID from http://www.openweathermap.org/help/city_list.txt
		appid: "hidden"
	}
},

Additional Notes: Provide any other relevant notes not previously mentioned. This is optional.
Code in weatherforecast.js line 353 : rain: this.roundValue(forecast.rain)
That is rounding the value before it does the calculation to convert into imperial.

@MichMich
Copy link
Collaborator

Fix merged: #1376

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

2 participants