1 """Platform for climate integration."""
3 from __future__
import annotations
7 from devolo_home_control_api.devices.zwave
import Zwave
8 from devolo_home_control_api.homecontrol
import HomeControl
20 from .
import DevoloHomeControlConfigEntry
21 from .devolo_multi_level_switch
import DevoloMultiLevelSwitchDeviceEntity
26 entry: DevoloHomeControlConfigEntry,
27 async_add_entities: AddEntitiesCallback,
29 """Get all cover devices and setup them via config entry."""
34 device_instance=device,
35 element_uid=multi_level_switch,
37 for gateway
in entry.runtime_data
38 for device
in gateway.multi_level_switch_devices
39 for multi_level_switch
in device.multi_level_switch_property
40 if device.device_model_uid
42 "devolo.model.Thermostat:Valve",
43 "devolo.model.Room:Thermostat",
44 "devolo.model.Eurotronic:Spirit:Device",
45 "unk.model.Danfoss:Thermostat",
51 """Representation of a climate/thermostat device within devolo Home Control."""
53 _attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
54 _attr_target_temperature_step = PRECISION_HALVES
55 _attr_temperature_unit = UnitOfTemperature.CELSIUS
56 _attr_precision = PRECISION_TENTHS
57 _attr_hvac_mode = HVACMode.HEAT
58 _attr_hvac_modes = [HVACMode.HEAT]
59 _enable_turn_on_off_backwards_compatibility =
False
62 self, homecontrol: HomeControl, device_instance: Zwave, element_uid: str
64 """Initialize a climate entity within devolo Home Control."""
66 homecontrol=homecontrol,
67 device_instance=device_instance,
68 element_uid=element_uid,
76 """Return the current temperature."""
77 if hasattr(self.
_device_instance_device_instance,
"multi_level_sensor_property"):
80 multi_level_sensor.value
81 for multi_level_sensor
in self.
_device_instance_device_instance.multi_level_sensor_property.values()
82 if multi_level_sensor.sensor_type ==
"temperature"
91 """Return the target temperature."""
95 """Do nothing as devolo devices do not support changing the hvac mode."""
98 """Set new target temperature."""
None set_hvac_mode(self, HVACMode hvac_mode)
float|None target_temperature(self)
None __init__(self, HomeControl homecontrol, Zwave device_instance, str element_uid)
None set_temperature(self, **Any kwargs)
float|None current_temperature(self)
_multi_level_switch_property
None async_setup_entry(HomeAssistant hass, DevoloHomeControlConfigEntry entry, AddEntitiesCallback async_add_entities)