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

hPa decimals #14

Closed
TheLordVader opened this issue Sep 17, 2021 · 10 comments
Closed

hPa decimals #14

TheLordVader opened this issue Sep 17, 2021 · 10 comments

Comments

@TheLordVader
Copy link

Thanks for your work; love it!

But how do I round the decimals for hPa using Pirateweather? When using yr.no or Swedish SMHI as provider, there are "normal" decimals...

Screenshot 2021-09-17 at 14 45 20

@alexander0042
Copy link
Collaborator

Thanks for pointing this out (and using this service)! I thought I'd fixed this bug, but apparently not! Let me dig into it and see if I can't tease this one out for good.

@alexander0042
Copy link
Collaborator

Got it! Turns out that I fixed it (nothing fancy, just a python round() ) for currently and hourly conditions, but forgot about daily. It's updating now, so should work its way through the cache in about half an hour or so

@TheLordVader
Copy link
Author

Thank you for a fast reply! Great, dig when you have the time, and thanks for your effort!

@giustanca
Copy link

Hi, same problem here. There is a solution?

@alexander0042
Copy link
Collaborator

That's weird- I thought I fixed this one, but clearly not!
What unit system are you using?

@giustanca
Copy link

The unit system is metric
Screenshot_20211002-203138

@alexander0042
Copy link
Collaborator

Ok, fixed this one for real this time! The values were rounded, but when they were multiplied by the units for the pressure, Python would sometimes have issues with the floating points, leading to this issue.
I added another rounding statement at the output step, so should be good to go here!

Sorry about this, and thanks again for bringing it to my attention

@risozhor
Copy link

risozhor commented Oct 4, 2021

FYI: I'm just edited one line in "/config/custom_components/pirateweather/weather.py" file, and it works for me
2021-10-04_150752

alexander0042 added a commit that referenced this issue Oct 4, 2021
@alexander0042
Copy link
Collaborator

Great point! It should be fixed on the back end with the last API update, but I like this solution too, since this integration does its own processing. Just pushed this commit: 2ead964

@giustanca
Copy link

Problem solved. Thank you very much!

@github-actions github-actions bot locked and limited conversation to collaborators Jul 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants