1 """Support for Proliphix NT10e Thermostats."""
3 from __future__
import annotations
8 import voluptuous
as vol
11 PLATFORM_SCHEMA
as CLIMATE_PLATFORM_SCHEMA,
32 PLATFORM_SCHEMA = CLIMATE_PLATFORM_SCHEMA.extend(
34 vol.Required(CONF_HOST): cv.string,
35 vol.Required(CONF_USERNAME): cv.string,
36 vol.Required(CONF_PASSWORD): cv.string,
44 add_entities: AddEntitiesCallback,
45 discovery_info: DiscoveryInfoType |
None =
None,
47 """Set up the Proliphix thermostats."""
48 username = config.get(CONF_USERNAME)
49 password = config.get(CONF_PASSWORD)
50 host = config.get(CONF_HOST)
52 pdp = proliphix.PDP(host, username, password)
59 """Representation a Proliphix thermostat."""
61 _attr_precision = PRECISION_TENTHS
62 _attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
63 _attr_temperature_unit = UnitOfTemperature.FAHRENHEIT
64 _enable_turn_on_off_backwards_compatibility =
False
67 """Initialize the thermostat."""
72 """Update the data from the thermostat."""
78 """Return the name of the thermostat."""
79 return self.
_name_name
83 """Return the device specific state attributes."""
84 return {ATTR_FAN: self.
_pdp_pdp.fan_state}
88 """Return the current temperature."""
89 return self.
_pdp_pdp.cur_temp
93 """Return the temperature we try to reach."""
94 return self.
_pdp_pdp.setback
98 """Return the current state of the thermostat."""
99 state = self.
_pdp_pdp.hvac_state
101 return HVACAction.OFF
102 if state
in (3, 4, 5):
103 return HVACAction.HEATING
105 return HVACAction.COOLING
106 return HVACAction.IDLE
110 """Return the current state of the thermostat."""
111 if self.
_pdp_pdp.is_heating:
113 if self.
_pdp_pdp.is_cooling:
119 """Return available HVAC modes."""
123 """Set new target temperature."""
124 if (temperature := kwargs.get(ATTR_TEMPERATURE))
is None:
126 self.
_pdp_pdp.setback = temperature
def extra_state_attributes(self)
None set_temperature(self, **Any kwargs)
def target_temperature(self)
list[HVACMode] hvac_modes(self)
def current_temperature(self)
HVACAction hvac_action(self)
None add_entities(AsusWrtRouter router, AddEntitiesCallback async_add_entities, set[str] tracked)
None setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)