From acc974b26b40917ab4029cf700b3102d336e72d1 Mon Sep 17 00:00:00 2001 From: bvweerd Date: Mon, 3 Jan 2022 14:04:23 +0100 Subject: [PATCH] Add eq3btsmart presets on, off, auto and manual mode (#54586) Co-authored-by: Franck Nijhof Co-authored-by: Teemu R --- .../components/eq3btsmart/climate.py | 20 +++++++++++++++++-- homeassistant/components/eq3btsmart/const.py | 6 ++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 homeassistant/components/eq3btsmart/const.py diff --git a/homeassistant/components/eq3btsmart/climate.py b/homeassistant/components/eq3btsmart/climate.py index 5895268a50d..44329c95eb1 100644 --- a/homeassistant/components/eq3btsmart/climate.py +++ b/homeassistant/components/eq3btsmart/climate.py @@ -31,6 +31,8 @@ from homeassistant.helpers.device_registry import format_mac from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType +from .const import PRESET_CLOSED, PRESET_NO_HOLD, PRESET_OPEN, PRESET_PERMANENT_HOLD + _LOGGER = logging.getLogger(__name__) STATE_BOOST = "boost" @@ -56,9 +58,23 @@ HA_TO_EQ_HVAC = { HVAC_MODE_AUTO: eq3.Mode.Auto, } -EQ_TO_HA_PRESET = {eq3.Mode.Boost: PRESET_BOOST, eq3.Mode.Away: PRESET_AWAY} +EQ_TO_HA_PRESET = { + eq3.Mode.Boost: PRESET_BOOST, + eq3.Mode.Away: PRESET_AWAY, + eq3.Mode.Manual: PRESET_PERMANENT_HOLD, + eq3.Mode.Auto: PRESET_NO_HOLD, + eq3.Mode.Open: PRESET_OPEN, + eq3.Mode.Closed: PRESET_CLOSED, +} -HA_TO_EQ_PRESET = {PRESET_BOOST: eq3.Mode.Boost, PRESET_AWAY: eq3.Mode.Away} +HA_TO_EQ_PRESET = { + PRESET_BOOST: eq3.Mode.Boost, + PRESET_AWAY: eq3.Mode.Away, + PRESET_PERMANENT_HOLD: eq3.Mode.Manual, + PRESET_NO_HOLD: eq3.Mode.Auto, + PRESET_OPEN: eq3.Mode.Open, + PRESET_CLOSED: eq3.Mode.Closed, +} DEVICE_SCHEMA = vol.Schema({vol.Required(CONF_MAC): cv.string}) diff --git a/homeassistant/components/eq3btsmart/const.py b/homeassistant/components/eq3btsmart/const.py new file mode 100644 index 00000000000..af90acbde55 --- /dev/null +++ b/homeassistant/components/eq3btsmart/const.py @@ -0,0 +1,6 @@ +"""Constants for EQ3 Bluetooth Smart Radiator Valves.""" + +PRESET_PERMANENT_HOLD = "permanent_hold" +PRESET_NO_HOLD = "no_hold" +PRESET_OPEN = "open" +PRESET_CLOSED = "closed"