Skip to content

Commit

Permalink
Handle int or mapping for off case in nibe cooling (#89680)
Browse files Browse the repository at this point in the history
Handle int or mapping for off case in nibe
  • Loading branch information
elupus authored and frenck committed Mar 16, 2023
1 parent a9a6ff5 commit 02738fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions homeassistant/components/nibe_heatpump/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from .const import (
DOMAIN,
LOGGER,
VALUES_COOL_WITH_ROOM_SENSOR_OFF,
VALUES_MIXING_VALVE_CLOSED_STATE,
VALUES_PRIORITY_COOLING,
VALUES_PRIORITY_HEATING,
Expand Down Expand Up @@ -139,10 +140,13 @@ def _get_float(coil: Coil) -> float | None:

mode = HVACMode.OFF
if _get_value(self._coil_use_room_sensor) == "ON":
if _get_value(self._coil_cooling_with_room_sensor) != "OFF":
mode = HVACMode.HEAT_COOL
else:
if (
_get_value(self._coil_cooling_with_room_sensor)
in VALUES_COOL_WITH_ROOM_SENSOR_OFF
):
mode = HVACMode.HEAT
else:
mode = HVACMode.HEAT_COOL
self._attr_hvac_mode = mode

setpoint_heat = _get_float(self._coil_setpoint_heat)
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/nibe_heatpump/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
VALUES_MIXING_VALVE_CLOSED_STATE = (30, "CLOSED", "SHUNT CLOSED")
VALUES_PRIORITY_HEATING = (30, "HEAT")
VALUES_PRIORITY_COOLING = (60, "COOLING")
VALUES_COOL_WITH_ROOM_SENSOR_OFF = (0, "OFF")

0 comments on commit 02738fb

Please sign in to comment.