1 """nVent RAYCHEM SENZ climate platform."""
3 from __future__
import annotations
7 from aiosenz
import MODE_AUTO, Thermostat
22 from .
import SENZDataUpdateCoordinator
23 from .const
import DOMAIN
29 async_add_entities: AddEntitiesCallback,
31 """Set up the SENZ climate entities from a config entry."""
32 coordinator: SENZDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
34 SENZClimate(thermostat, coordinator)
for thermostat
in coordinator.data.values()
39 """Representation of a SENZ climate entity."""
41 _attr_temperature_unit = UnitOfTemperature.CELSIUS
42 _attr_precision = PRECISION_TENTHS
43 _attr_hvac_modes = [HVACMode.HEAT, HVACMode.AUTO]
44 _attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
47 _attr_has_entity_name =
True
49 _enable_turn_on_off_backwards_compatibility =
False
53 thermostat: Thermostat,
54 coordinator: SENZDataUpdateCoordinator,
56 """Init SENZ climate."""
61 identifiers={(DOMAIN, thermostat.serial_number)},
62 manufacturer=
"nVent Raychem",
69 """Handle updated data from the coordinator."""
75 """Return the current temperature."""
76 return self.
_thermostat_thermostat.current_temperatue
80 """Return the temperature we try to reach."""
81 return self.
_thermostat_thermostat.setpoint_temperature
85 """Return True if the thermostat is available."""
90 """Return hvac operation ie. auto, heat mode."""
97 """Return current hvac action."""
98 return HVACAction.HEATING
if self.
_thermostat_thermostat.is_heating
else HVACAction.IDLE
101 """Set new target hvac mode."""
102 if hvac_mode == HVACMode.AUTO:
106 await self.coordinator.async_request_refresh()
109 """Set new target temperature."""
110 temp: float = kwargs[ATTR_TEMPERATURE]
112 await self.coordinator.async_request_refresh()
None async_set_hvac_mode(self, HVACMode hvac_mode)
float current_temperature(self)
float target_temperature(self)
None _handle_coordinator_update(self)
None async_set_temperature(self, **Any kwargs)
None __init__(self, Thermostat thermostat, SENZDataUpdateCoordinator coordinator)
HVACAction hvac_action(self)
None async_write_ha_state(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)