1 """Support for LightwaveRF TRVs."""
3 from __future__
import annotations
20 from .
import CONF_SERIAL, LIGHTWAVE_LINK
26 async_add_entities: AddEntitiesCallback,
27 discovery_info: DiscoveryInfoType |
None =
None,
29 """Find and return LightWave lights."""
30 if discovery_info
is None:
34 lwlink = hass.data[LIGHTWAVE_LINK]
36 for device_id, device_config
in discovery_info.items():
37 name = device_config[CONF_NAME]
38 serial = device_config[CONF_SERIAL]
39 entities.append(
LightwaveTrv(name, device_id, lwlink, serial))
45 """Representation of a LightWaveRF TRV."""
47 _attr_hvac_mode = HVACMode.HEAT
48 _attr_hvac_modes = [HVACMode.HEAT, HVACMode.OFF]
49 _attr_min_temp = DEFAULT_MIN_TEMP
50 _attr_max_temp = DEFAULT_MAX_TEMP
51 _attr_supported_features = (
52 ClimateEntityFeature.TARGET_TEMPERATURE
53 | ClimateEntityFeature.TURN_OFF
54 | ClimateEntityFeature.TURN_ON
56 _attr_target_temperature_step = 0.5
57 _attr_temperature_unit = UnitOfTemperature.CELSIUS
58 _enable_turn_on_off_backwards_compatibility =
False
60 def __init__(self, name, device_id, lwlink, serial):
61 """Initialize LightwaveTrv entity."""
71 """Communicate with a Lightwave RTF Proxy to get state."""
72 (temp, targ, _, trv_output) = self.
_lwlink_lwlink.read_trv_status(self.
_serial_serial)
87 if trv_output
is not None:
95 """Target room temperature."""
105 """Set TRV target temperature."""
106 if ATTR_TEMPERATURE
in kwargs:
114 """Set HVAC Mode for TRV."""
def __init__(self, name, device_id, lwlink, serial)
None async_set_hvac_mode(self, HVACMode hvac_mode)
_attr_current_temperature
def target_temperature(self)
None set_temperature(self, **Any kwargs)
None async_setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)