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

Fix Precipitation Accumulation Units #168

Merged
merged 2 commits into from
Jan 5, 2024
Merged

Conversation

cloneofghosts
Copy link
Collaborator

@cloneofghosts cloneofghosts commented Jan 3, 2024

When precipAccumulation was changed from cm to mm in #122 the conversion was never changed to convert from mm to inches. This PR changes the conversion and fixes #166

Is precipAccumulation on hourly in mm or cm? If it's cm then we need to convert it to mm otherwise the conversion on hourly will be incorrect. Edit: Looked at the code and it's using a different variable.

@cloneofghosts cloneofghosts added the bugfix A bug has been fixed label Jan 3, 2024
@cloneofghosts
Copy link
Collaborator Author

I realized last night while looking at the precipitation amounts that it was converting cm to mm by multiplying by 100 instead of 10. (I saw one day report 880mm of precipitation which is obviously incorrect).

I was doing a quick test and noticed that none of the conversions were rounded and it leads to a crazy amount of decimal places. Maybe we can do the same thing as the percentages where if rounding is enabled it rounds the values to the nearest decimal otherwise 2/4 decimal places?

@cloneofghosts cloneofghosts merged commit f96f86d into master Jan 5, 2024
6 checks passed
@cloneofghosts cloneofghosts deleted the precipAccumulationFix branch January 7, 2024 03:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix A bug has been fixed
Projects
Development

Successfully merging this pull request may close these issues.

Rain estimates from homeassistant service call are off from merrysky.net values by an order of magnitude
2 participants