-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Separate climate platform and presentation units #3755
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
Conversation
return self.hass.config.units.temperature_unit | ||
|
||
@property | ||
def _platform_unit_of_measurement(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- D400: First line should end with a period (not 'm')
Hrm. |
Maybe
@turbokongen did the backend for this and I worked on the polymer side of it. |
Related issue: #3605 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🐬 ! This is good to go once the property is renamed (which will solve the linting issue too)
return self.hass.config.units.temperature_unit | ||
|
||
@property | ||
def _platform_unit_of_measurement(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename this to temperature_unit
?
🐬 🍺 |
Description: The
unit_of_measurement
method in the climate component has an overloaded meaning. Firstly, the rest of home-assistant uses it as the unit that should be displayed to the user. Secondly, platforms in the climate component use it to represent the unit used by the backing system, and have to implement it, as it raises a NotImplementedError otherwise.This overload of meanings means that values are converted to the user's desired display unit, but the string which is appended for display is the unit used by the platform (often times not configurable).
This splits the two meanings into two separate attributes.
Related issue (if applicable): fixes #3445
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#
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:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass