Tado code quality improvements#107678
Conversation
|
Hey there @michaelarnauts, @chiefdragon, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
edenhaus
left a comment
There was a problem hiding this comment.
Please update the description, as there are changes outside the binary sensor.
It looks like there are also some bug fixes. Please add them to the description, too
| self._attr_fan_modes = supported_fan_modes | ||
| self._attr_supported_features = support_flags | ||
|
|
||
| # Why are they here? Part of generic thermostat it seems? Need to be set? |
There was a problem hiding this comment.
They seem unused. Is needed for all climate controls? I simply don't know why it's there at this point.
There was a problem hiding this comment.
Then please remove them if they are not used in the parent classes.
|
|
||
| def _normalize_target_temp_for_hvac_mode(self): | ||
| def _normalize_target_temp_for_hvac_mode(self) -> None: | ||
| def adjust_temp(min_temp, max_temp): |
There was a problem hiding this comment.
Why is this an inline function?
It should be a util function IMHO
There was a problem hiding this comment.
The only use case is within this function. That's why I put it inline.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Co-authored-by: Robert Resch <robert@resch.dev>
| self._attr_fan_modes = supported_fan_modes | ||
| self._attr_supported_features = support_flags | ||
|
|
||
| # Why are they here? Part of generic thermostat it seems? Need to be set? |
There was a problem hiding this comment.
Then please remove them if they are not used in the parent classes.
|
|
||
| def _normalize_target_temp_for_hvac_mode(self): | ||
| def _normalize_target_temp_for_hvac_mode(self) -> None: | ||
| def adjust_temp(min_temp, max_temp): |
edenhaus
left a comment
There was a problem hiding this comment.
If the integration is completely typed we can add tado to .strict-typing and add a section for it in mypy.ini (If not already done)
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Robert Resch <robert@resch.dev>
This would also require the |
Breaking change
Proposed change
Refactor the files Binary Sensor, Climate and Water Heater to be more strict and add typing where missing. Also some various code improvements have been made to make code less redundant and fit with typing.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: