Handle int or mapping for off case in nibe cooling (#89680)

Handle int or mapping for off case in nibe
This commit is contained in:
Joakim Plate 2023-03-16 13:26:56 +01:00 committed by Franck Nijhof
parent a9a6ff50cc
commit 02738fb9d4
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 8 additions and 3 deletions

View File

@ -31,6 +31,7 @@ from . import Coordinator
from .const import (
DOMAIN,
LOGGER,
VALUES_COOL_WITH_ROOM_SENSOR_OFF,
VALUES_MIXING_VALVE_CLOSED_STATE,
VALUES_PRIORITY_COOLING,
VALUES_PRIORITY_HEATING,
@ -139,10 +140,13 @@ class NibeClimateEntity(CoordinatorEntity[Coordinator], ClimateEntity):
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)

View File

@ -17,3 +17,4 @@ CONF_MODBUS_UNIT = "modbus_unit"
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")