Skip to content

Commit

Permalink
Add more documentation.
Browse files Browse the repository at this point in the history
Corrected removed property by mistake.
Use more constants from pyOverkiz.
  • Loading branch information
egguy committed Jan 18, 2022
1 parent 3cb7bd0 commit 253baf5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,19 @@


class SomfyHeatingTemperatureInterface(OverkizEntity, ClimateEntity):
"""Representation of Somfy Heating Temperature Interface."""
"""Representation of Somfy Heating Temperature Interface.
The thermostat has 3 ways of working:
- Auto: Switch to eco/comfort temperature on a schedule (day/hour of the day)
- Manual comfort: The thermostat use the temperature of the comfort setting (19°C degree by default)
- Manual eco: The thermostat use the temperature of the eco setting (17°C by default)
- Freeze protection: The thermostat use the temperature of the freeze protection (7°C by default)
There's also the possibility to change the working mode, this can be used to change from a heated
floor to a cooling floor in the summer.
documentation: https://damrexelprod.blob.core.windows.net/medias/2fb79f22-2075-4f5a-93d3-112b14a4b8c2
"""

_attr_temperature_unit = TEMP_CELSIUS
_attr_hvac_modes = [*HVAC_MODES_TO_OVERKIZ]
Expand Down Expand Up @@ -140,6 +152,9 @@ def target_temperature(self) -> Optional[float]:
if self.preset_mode not in PRESET_MODES_TO_OVERKIZ:
return None

# Allow to get the current target temperature for the current preset
# The preset can be switch manually or on a schedule (auto).
# This allows to reflect the current target temperature automatically
mode = PRESET_MODES_TO_OVERKIZ[self.preset_mode]
if mode not in MAP_PRESET_TEMPERATURES:
return None
Expand Down
13 changes: 10 additions & 3 deletions custom_components/tahoma/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
command=OverkizCommand.SET_ECO_TEMPERATURE,
min_value=6,
max_value=29,
step=0.5,
entity_category=EntityCategory.CONFIG,
),
OverkizNumberDescription(
Expand All @@ -45,7 +44,6 @@
command=OverkizCommand.SET_COMFORT_TEMPERATURE,
min_value=7,
max_value=30,
step=0.5,
entity_category=EntityCategory.CONFIG,
),
OverkizNumberDescription(
Expand All @@ -55,7 +53,6 @@
command=OverkizCommand.SET_SECURED_POSITION_TEMPERATURE,
min_value=5,
max_value=15,
step=0.5,
entity_category=EntityCategory.CONFIG,
),
]
Expand Down Expand Up @@ -110,3 +107,13 @@ async def async_set_value(self, value: float) -> None:
await self.executor.async_execute_command(
self.entity_description.command, value
)

@property
def min_value(self) -> float:
"""Return the minimum value."""
return self.entity_description.min_value or self._attr_min_value

@property
def max_value(self) -> float:
"""Return the maximum value."""
return self.entity_description.max_value or self._attr_max_value
2 changes: 1 addition & 1 deletion custom_components/tahoma/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
icon="mdi:sun-snowflake",
options=[OverkizCommandParam.HEATING, OverkizCommandParam.COOLING],
select_option=lambda option, execute_command: execute_command(
"setOperatingMode", option
OverkizCommand.SET_OPERATING_MODE, option
),
entity_category=EntityCategory.CONFIG,
),
Expand Down

0 comments on commit 253baf5

Please sign in to comment.