Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix unit conversion #14730

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

Merged
merged 6 commits into from
Jun 8, 2018
Merged

Fix unit conversion #14730

merged 6 commits into from
Jun 8, 2018

Conversation

dgomes
Copy link
Contributor

@dgomes dgomes commented May 31, 2018

Description:

In a previous accepted PR #14690 a bug was introduced when global HA temperature unit in Fahrenheit.

This PR reverts changes in generic_thermostat and sensible, but re-engineers tado, since tado always has a min_temp/max_temp and doesn't require the DEFAULT_*.

Related issue (if applicable): fixes #14690

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 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.


return DEFAULT_MAX_TEMP
return convert_temperature(self._max_temp, self._unit,
hass.config.units.temperature_unit)

Choose a reason for hiding this comment

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

undefined name 'hass'


return DEFAULT_MIN_TEMP
return convert_temperature(self._min_temp, self._unit,
hass.config.units.temperature_unit)

Choose a reason for hiding this comment

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

undefined name 'hass'

@@ -268,7 +267,8 @@ def min_temp(self):
if self._min_temp:
return self._min_temp

return DEFAULT_MIN_TEMP
# get default temp from super class
return ClimateDevice.min_temp.fget(self)
Copy link
Member

Choose a reason for hiding this comment

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

Why can't you call super().min_temp like you do in the other platforms?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was just reverting to the previous version... but I agree with your comment, will do the change

@balloob
Copy link
Member

balloob commented Jun 7, 2018

btw impressive that you managed to open a PR 7 days ago with a fix for a PR I merged 3 hours ago 😝

@ghost ghost assigned dgomes Jun 7, 2018
@ghost ghost added in progress and removed small-pr PRs with less than 30 lines. labels Jun 7, 2018
@dgomes
Copy link
Contributor Author

dgomes commented Jun 7, 2018

Thats how long ago I noticed the issue (during review) and prepared this :)

@balloob balloob merged commit bb00689 into home-assistant:dev Jun 8, 2018
@ghost ghost removed the in progress label Jun 8, 2018
@balloob balloob mentioned this pull request Jun 22, 2018
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
* reviewing this code min_temp and max_temp are always present and always in celsius

* revert change (preserve unit conversion)

* revert (due to unit conversion)

* self

* clean

* cleaner
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
@dgomes dgomes deleted the fix_unit_conversion branch April 7, 2022 18:10
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