Skip to content

Round precipitation forecast to 1 decimal place#15759

Merged
fabaff merged 1 commit intohome-assistant:devfrom
priiduonu:dev
Jul 31, 2018
Merged

Round precipitation forecast to 1 decimal place#15759
fabaff merged 1 commit intohome-assistant:devfrom
priiduonu:dev

Conversation

@priiduonu
Copy link
Copy Markdown
Contributor

The OWM returns precipitation forecast values as they are submitted to their network. It can lead to values like 0.0025000000000004 mm which does not make sense and messes up the display card. This PR rounds the value to 1 decimal place.

Description:

Related issue (if applicable): fixes #

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

The OWM returns precipitation forecast values as they are submitted to their network. It can lead to values like `0.0025000000000004 mm` which does not make sense and messes up the display card. This PR rounds the value to 1 decimal place.
@priiduonu
Copy link
Copy Markdown
Contributor Author

Before:

valik_117

After:

valik_118

Copy link
Copy Markdown
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🐦

@fabaff fabaff merged commit 03847e6 into home-assistant:dev Jul 31, 2018
@ghost ghost removed the in progress label Jul 31, 2018
@Yevgenium
Copy link
Copy Markdown
Contributor

Hello @priiduonu. Could you make the same PR for the OWM daily forecast?

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Aug 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants