-
Notifications
You must be signed in to change notification settings - Fork 7
Intermediate Core downstream / prepare tagging upstream #700
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
Changes from all commits
661b26c
08d184d
3ea17a9
91f52df
ed027d2
211a06a
b0d90b0
2f6a750
ee3a57a
2b4c5b5
b1a0078
d8ab6bd
cd1fe9a
fcdda05
1664c00
57b27de
3d4eaf4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| """Plugwise Climate component for Home Assistant.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from typing import Any | ||
|
|
@@ -58,13 +59,15 @@ | |
| from .entity import PlugwiseEntity | ||
| from .util import plugwise_command | ||
|
|
||
| PARALLEL_UPDATES = 0 # Upstream | ||
|
|
||
|
|
||
| async def async_setup_entry( | ||
| hass: HomeAssistant, | ||
| entry: PlugwiseConfigEntry, | ||
| async_add_entities: AddEntitiesCallback, | ||
| ) -> None: | ||
| """Set up the Plugwise thermostats from a ConfigEntry.""" | ||
| """Set up Plugwise thermostats from a config entry.""" | ||
| coordinator = entry.runtime_data | ||
| homekit_enabled: bool = entry.options.get( | ||
| CONF_HOMEKIT_EMULATION, False | ||
|
|
@@ -102,8 +105,8 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity): | |
| _attr_translation_key = DOMAIN | ||
| _enable_turn_on_off_backwards_compatibility = False | ||
|
|
||
| _homekit_mode: str | None = None # pw-beta homekit emulation | ||
| _previous_mode: str = HVACAction.HEATING | ||
| _previous_mode: str = HVACAction.HEATING # Upstream | ||
| _homekit_mode: str | None = None # pw-beta homekit emulation + intentional unsort | ||
|
|
||
| def __init__( | ||
| self, | ||
|
|
@@ -234,13 +237,9 @@ def hvac_action(self) -> HVACAction: # pw-beta add to Core | |
| self._previous_action_mode(self.coordinator) | ||
|
|
||
| # Adam provides the hvac_action for each thermostat | ||
| if (control_state := self.device.get(CONTROL_STATE)) == HVACAction.COOLING: | ||
| return HVACAction.COOLING | ||
| if control_state == HVACAction.HEATING: | ||
| return HVACAction.HEATING | ||
| if control_state == HVACAction.PREHEATING: | ||
| return HVACAction.PREHEATING | ||
| if control_state == STATE_OFF: | ||
| if (control_state := self.device.get(CONTROL_STATE)) in (HVACAction.COOLING, HVACAction.HEATING, HVACAction.PREHEATING): | ||
CoMPaTech marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return control_state | ||
| if control_state == HVACMode.OFF: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this work with mypy?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The strange thing is some
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant the |
||
| return HVACAction.IDLE | ||
|
|
||
| # Anna | ||
|
|
@@ -269,11 +268,7 @@ async def async_set_temperature(self, **kwargs: Any) -> None: | |
| if ATTR_TARGET_TEMP_LOW in kwargs: | ||
| data[TARGET_TEMP_LOW] = kwargs.get(ATTR_TARGET_TEMP_LOW) | ||
|
|
||
| for temperature in data.values(): | ||
| if temperature is None or not ( | ||
| self._attr_min_temp <= temperature <= self._attr_max_temp | ||
| ): | ||
| raise ValueError("Invalid temperature change requested") | ||
| # Upstream removed input-valid check | ||
|
|
||
| if mode := kwargs.get(ATTR_HVAC_MODE): | ||
| await self.async_set_hvac_mode(mode) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.