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 current_temperature is rounded #6960

Merged
merged 2 commits into from
Apr 7, 2017

Conversation

aufano
Copy link
Contributor

@aufano aufano commented Apr 6, 2017

Description:

Fix now when temperature_unit == unit_of_measurement the convert_to_display will round it.

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:

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

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

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New 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:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@emlove
Copy link
Contributor

emlove commented Apr 6, 2017

See also #4522

@aufano
Copy link
Contributor Author

aufano commented Apr 6, 2017

I dont know the right way to fix the problem because in the #4522 @balloob said "Do not convert when passed in unit is already expected unit" but the problem is that my zwave radiator pass a lot of decimals in celsius and I have my home assistant temperature in celsius too.., so the code don't round it.

@emlove
Copy link
Contributor

emlove commented Apr 6, 2017

I think this is a reasonable fix myself, but I want to make sure we're looking at the whole history of this code in case there was some other relevant side-effect from the previous PR. (Want to make sure we're jogging @balloob's memory. 😄 )

In any case showing all of the decimal places in the frontend is a defect IMO, and we need some solution.

@balloob
Copy link
Member

balloob commented Apr 7, 2017

Yeah this looks good. Thanks for the fix 🐬

@balloob balloob merged commit 2ce8c2f into home-assistant:dev Apr 7, 2017
@balloob balloob added this to the 0.42 milestone Apr 7, 2017
balloob pushed a commit that referenced this pull request Apr 8, 2017
* Fix current_temperature is rounded

* fix  Unnecessary parens after 'if'
@balloob
Copy link
Member

balloob commented Apr 8, 2017

Cherry-picked into the 0.42 branch

@fabaff fabaff mentioned this pull request Apr 8, 2017
@balloob balloob mentioned this pull request Apr 21, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Jul 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants