Skip to content

Commit

Permalink
Add Comfort 1 and Comfort 2 to Sauter Raditator
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed Nov 18, 2023
1 parent 5210ded commit 679b3b3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
36 changes: 28 additions & 8 deletions custom_components/heatzy/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Any

from heatzypy.exception import HeatzyException

from homeassistant.components.climate import (
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
Expand Down Expand Up @@ -53,6 +54,8 @@
GLOW,
PILOTE_V1,
PILOTE_V2,
PRESET_COMFORT_1,
PRESET_COMFORT_2,
)

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -226,8 +229,8 @@ class HeatzyPiloteV2Thermostat(HeatzyThermostat):
async def async_turn_on(self) -> None:
"""Turn device on."""
try:
if (
self._attr.get(CONF_DEROG_MODE) == 1
if ( # DEROG MODE - 1: VACATION , 2: BOOST
self._attr.get(CONF_DEROG_MODE) > 0
or self._attr.get(CONF_TIMER_SWITCH) == 1
):
await self.coordinator.api.async_control_device(
Expand All @@ -252,8 +255,8 @@ async def async_turn_on(self) -> None:
async def async_turn_off(self) -> None:
"""Turn device on."""
try:
if (
self._attr.get(CONF_DEROG_MODE) == 1
if ( # DEROG MODE - 1: VACATION , 2: BOOST
self._attr.get(CONF_DEROG_MODE) > 0
or self._attr.get(CONF_TIMER_SWITCH) == 1
):
await self.coordinator.api.async_control_device(
Expand Down Expand Up @@ -317,8 +320,7 @@ class Glowv1Thermostat(HeatzyPiloteV2Thermostat):
HA_TO_HEATZY_STATE = {PRESET_COMFORT: "cft", PRESET_ECO: "eco", PRESET_AWAY: "fro"}

_attr_supported_features = (
ClimateEntityFeature.PRESET_MODE
| ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
ClimateEntityFeature.PRESET_MODE | ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
)

@property
Expand Down Expand Up @@ -472,8 +474,7 @@ class Bloomv1Thermostat(HeatzyPiloteV2Thermostat):
"""Bloom."""

_attr_supported_features = (
ClimateEntityFeature.PRESET_MODE
| ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
ClimateEntityFeature.PRESET_MODE | ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
)

@property
Expand Down Expand Up @@ -536,3 +537,22 @@ async def async_set_temperature(self, **kwargs: Any) -> None:
await self.coordinator.async_request_refresh()
except HeatzyException as error:
_LOGGER.error("Error to set temperature: %s", error)


class Sauter(HeatzyPiloteV2Thermostat):
"""Sauter."""

HEATZY_TO_HA_STATE = {
"cft": PRESET_COMFORT,
"eco": PRESET_ECO,
"fro": PRESET_AWAY,
"cft1": PRESET_COMFORT_1,
"cft2": PRESET_COMFORT_2,
}
HA_TO_HEATZY_STATE = {
PRESET_COMFORT: 0,
PRESET_ECO: 1,
PRESET_AWAY: 2,
PRESET_COMFORT_1: "cft1",
PRESET_COMFORT_2: "cft2",
}
5 changes: 3 additions & 2 deletions custom_components/heatzy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@
ECO_TEMP_L = "eco_tempL"
FROST_TEMP = 7
PLATFORMS = ["climate", "switch"]
PRESET_COMFORT_1 = "comfort_1"
PRESET_COMFORT_2 = "comfort_2"

PILOTE_V1 = ["9420ae048da545c88fc6274d204dd25f"]
PILOTE_V2 = [
"51d16c22a5f74280bc3cfe9ebcdc6402",
"b9a67b6ce24b437d9794103fd317e627",
"4fc968a21e7243b390e9ede6f1c6465d",
"46409c7f29d4411c85a3a46e5ee3703e",
"b8c6657b66c34148b4dee64d615cefc7", # ELEC_PRO_SOC
]
GLOW = [
"2fd622e45283470f9e27e8e6167d7533",
"bb10d064f8de409db633b750faa22a52", # ONYX
"46409c7f29d4411c85a3a46e5ee3703e",
]
BLOOM = ["480253852d574f11b2d7fbf4460d7a41"]
SOC_3 = ["46409c7f29d4411c85a3a46e5ee3703e"] # Sauter Pilote_Soc_C3
2 changes: 1 addition & 1 deletion custom_components/heatzy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"issue_tracker": "https://github.com/cyr-ius/hass-heatzy/issues",
"loggers": ["heatzypy"],
"requirements": ["heatzypy==2.1.5"],
"version": "5.9.1"
"version": "5.9.3-beta"
}

0 comments on commit 679b3b3

Please sign in to comment.