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

refactor: refactor climate.py #614

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

SusanPhevos
Copy link
Contributor

Why

Thermostat, heater, bath heater needs to be added as the climate entity. However, the previous climate.py has many repetitive codes. This PR refactors climate.py by setting several base classes.

Added

Supporting thermostat and ptc bath heater.

Test

Self-tested with some limited model.

@topsworld topsworld changed the title Refactor climate.py refactor: refacor climate.py Jan 9, 2025
@topsworld topsworld added the enhancement New feature or request label Jan 13, 2025
@kekeandzeyu
Copy link
Contributor

Maybe the title should be refractor, not refacor?

@CLAassistant
Copy link

CLAassistant commented Jan 17, 2025

CLA assistant check
All committers have signed the CLA.

@topsworld topsworld changed the title refactor: refacor climate.py refactor: refactor climate.py Jan 17, 2025
@SusanPhevos SusanPhevos marked this pull request as ready for review January 21, 2025 03:10
elif prop.name == 'ac-state':
self._prop_ac_state = prop
self._value_ac_state = {}
self.sub_prop_changed(
prop=prop, handler=self.__ac_state_changed)

# hvac modes
if HVACMode.OFF not in self._attr_hvac_modes:
if self._attr_hvac_modes is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

An exception will occur here because _attr_hvac_modes is not initialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants