mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Fix climate platform in devolo Home Control (#40746)
Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
This commit is contained in:
parent
f28c3273c2
commit
bb2d3bf50d
@ -27,6 +27,7 @@ async def async_setup_entry(
|
||||
if device.device_model_uid in [
|
||||
"devolo.model.Thermostat:Valve",
|
||||
"devolo.model.Room:Thermostat",
|
||||
"devolo.model.Eurotronic:Spirit:Device",
|
||||
]:
|
||||
entities.append(
|
||||
DevoloClimateDeviceEntity(
|
||||
@ -44,6 +45,21 @@ class DevoloClimateDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, ClimateEntit
|
||||
|
||||
@property
|
||||
def current_temperature(self) -> Optional[float]:
|
||||
"""Return the current temperature."""
|
||||
if hasattr(self._device_instance, "multi_level_sensor_property"):
|
||||
return next(
|
||||
(
|
||||
multi_level_sensor.value
|
||||
for multi_level_sensor in self._device_instance.multi_level_sensor_property.values()
|
||||
if multi_level_sensor.sensor_type == "temperature"
|
||||
),
|
||||
None,
|
||||
)
|
||||
|
||||
return None
|
||||
|
||||
@property
|
||||
def target_temperature(self) -> Optional[float]:
|
||||
"""Return the current temperature."""
|
||||
return self._value
|
||||
|
||||
@ -82,6 +98,9 @@ class DevoloClimateDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, ClimateEntit
|
||||
"""Return the supported unit of temperature."""
|
||||
return TEMP_CELSIUS
|
||||
|
||||
def set_hvac_mode(self, hvac_mode: str) -> None:
|
||||
"""Do nothing as devolo devices do not support changing the hvac mode."""
|
||||
|
||||
def set_temperature(self, **kwargs):
|
||||
"""Set new target temperature."""
|
||||
self._multi_level_switch_property.set(kwargs[ATTR_TEMPERATURE])
|
||||
|
Loading…
x
Reference in New Issue
Block a user