Add venstar support for hvac action (#26956)
* Added support for current fan state and hvac action * Corrected handling of fan_mode
This commit is contained in:
parent
560ac3df3a
commit
f464a78088
1 changed files with 23 additions and 6 deletions
|
@ -11,14 +11,20 @@ from homeassistant.components.climate.const import (
|
|||
HVAC_MODE_AUTO,
|
||||
HVAC_MODE_COOL,
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
CURRENT_HVAC_HEAT,
|
||||
CURRENT_HVAC_COOL,
|
||||
CURRENT_HVAC_IDLE,
|
||||
CURRENT_HVAC_OFF,
|
||||
SUPPORT_FAN_MODE,
|
||||
FAN_ON,
|
||||
FAN_AUTO,
|
||||
SUPPORT_TARGET_HUMIDITY,
|
||||
SUPPORT_PRESET_MODE,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
PRESET_AWAY,
|
||||
PRESET_NONE,
|
||||
SUPPORT_TARGET_TEMPERATURE_RANGE,
|
||||
HVAC_MODE_OFF,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_TEMPERATURE,
|
||||
|
@ -156,7 +162,7 @@ class VenstarThermostat(ClimateDevice):
|
|||
|
||||
@property
|
||||
def hvac_mode(self):
|
||||
"""Return current operation ie. heat, cool, idle."""
|
||||
"""Return current operation mode ie. heat, cool, auto."""
|
||||
if self._client.mode == self._client.MODE_HEAT:
|
||||
return HVAC_MODE_HEAT
|
||||
if self._client.mode == self._client.MODE_COOL:
|
||||
|
@ -165,12 +171,23 @@ class VenstarThermostat(ClimateDevice):
|
|||
return HVAC_MODE_AUTO
|
||||
return HVAC_MODE_OFF
|
||||
|
||||
@property
|
||||
def hvac_action(self):
|
||||
"""Return current operation mode ie. heat, cool, auto."""
|
||||
if self._client.state == self._client.STATE_IDLE:
|
||||
return CURRENT_HVAC_IDLE
|
||||
if self._client.state == self._client.STATE_HEATING:
|
||||
return CURRENT_HVAC_HEAT
|
||||
if self._client.state == self._client.STATE_COOLING:
|
||||
return CURRENT_HVAC_COOL
|
||||
return CURRENT_HVAC_OFF
|
||||
|
||||
@property
|
||||
def fan_mode(self):
|
||||
"""Return the fan setting."""
|
||||
if self._client.fan == self._client.FAN_AUTO:
|
||||
return HVAC_MODE_AUTO
|
||||
return STATE_ON
|
||||
"""Return the current fan mode."""
|
||||
if self._client.fan == self._client.FAN_ON:
|
||||
return FAN_ON
|
||||
return FAN_AUTO
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue