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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Netatmo climate boost for valves #44957

Merged
merged 1 commit into from Jan 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 27 additions & 2 deletions homeassistant/components/netatmo/climate.py
Expand Up @@ -243,7 +243,11 @@ async def handle_event(self, event):
return

home = data["home"]
if self._home_id == home["id"] and data["event_type"] == EVENT_TYPE_THERM_MODE:

if self._home_id != home["id"]:
return

if data["event_type"] == EVENT_TYPE_THERM_MODE:
self._preset = NETATMO_MAP_PRESET[home[EVENT_TYPE_THERM_MODE]]
self._hvac_mode = HVAC_MAP_NETATMO[self._preset]
if self._preset == PRESET_FROST_GUARD:
Expand All @@ -266,8 +270,13 @@ async def handle_event(self, event):
elif room["therm_setpoint_mode"] == STATE_NETATMO_MAX:
self._hvac_mode = HVAC_MODE_HEAT
self._target_temperature = DEFAULT_MAX_TEMP
elif room["therm_setpoint_mode"] == STATE_NETATMO_MANUAL:
self._hvac_mode = HVAC_MODE_HEAT
self._target_temperature = room["therm_setpoint_temperature"]
else:
self._target_temperature = room["therm_setpoint_temperature"]
if self._target_temperature == DEFAULT_MAX_TEMP:
self._hvac_mode = HVAC_MODE_HEAT
self.async_write_ha_state()
break

Expand Down Expand Up @@ -341,12 +350,28 @@ def set_preset_mode(self, preset_mode: str) -> None:
STATE_NETATMO_HOME,
)

if preset_mode in [PRESET_BOOST, STATE_NETATMO_MAX] and self._model == NA_VALVE:
if (
preset_mode in [PRESET_BOOST, STATE_NETATMO_MAX]
and self._model == NA_VALVE
and self.hvac_mode == HVAC_MODE_HEAT
):
self._home_status.set_room_thermpoint(
self._id,
STATE_NETATMO_HOME,
)
elif (
preset_mode in [PRESET_BOOST, STATE_NETATMO_MAX] and self._model == NA_VALVE
):
self._home_status.set_room_thermpoint(
self._id,
STATE_NETATMO_MANUAL,
DEFAULT_MAX_TEMP,
)
elif (
preset_mode in [PRESET_BOOST, STATE_NETATMO_MAX]
and self.hvac_mode == HVAC_MODE_HEAT
):
self._home_status.set_room_thermpoint(self._id, STATE_NETATMO_HOME)
elif preset_mode in [PRESET_BOOST, STATE_NETATMO_MAX]:
self._home_status.set_room_thermpoint(
self._id, PRESET_MAP_NETATMO[preset_mode]
Expand Down