mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
thermostat: move fan attribute up to thermostat
This commit is contained in:
parent
afa4fc4ef5
commit
a0ed469aa2
@ -34,6 +34,7 @@ STATE_IDLE = "idle"
|
|||||||
|
|
||||||
ATTR_CURRENT_TEMPERATURE = "current_temperature"
|
ATTR_CURRENT_TEMPERATURE = "current_temperature"
|
||||||
ATTR_AWAY_MODE = "away_mode"
|
ATTR_AWAY_MODE = "away_mode"
|
||||||
|
ATTR_FAN = "fan"
|
||||||
ATTR_MAX_TEMP = "max_temp"
|
ATTR_MAX_TEMP = "max_temp"
|
||||||
ATTR_MIN_TEMP = "min_temp"
|
ATTR_MIN_TEMP = "min_temp"
|
||||||
ATTR_TEMPERATURE_LOW = "target_temp_low"
|
ATTR_TEMPERATURE_LOW = "target_temp_low"
|
||||||
@ -167,6 +168,10 @@ class ThermostatDevice(Entity):
|
|||||||
if is_away is not None:
|
if is_away is not None:
|
||||||
data[ATTR_AWAY_MODE] = STATE_ON if is_away else STATE_OFF
|
data[ATTR_AWAY_MODE] = STATE_ON if is_away else STATE_OFF
|
||||||
|
|
||||||
|
is_fan_on = self.is_fan_on
|
||||||
|
if is_fan_on is not None:
|
||||||
|
data[ATTR_FAN] = STATE_ON if is_fan_on else STATE_OFF
|
||||||
|
|
||||||
device_attr = self.device_state_attributes
|
device_attr = self.device_state_attributes
|
||||||
|
|
||||||
if device_attr is not None:
|
if device_attr is not None:
|
||||||
@ -212,6 +217,14 @@ class ThermostatDevice(Entity):
|
|||||||
"""
|
"""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_fan_on(self):
|
||||||
|
"""
|
||||||
|
Returns if the fan is on
|
||||||
|
Return None if not available.
|
||||||
|
"""
|
||||||
|
return None
|
||||||
|
|
||||||
def set_temperate(self, temperature):
|
def set_temperate(self, temperature):
|
||||||
""" Set new target temperature. """
|
""" Set new target temperature. """
|
||||||
pass
|
pass
|
||||||
|
@ -66,7 +66,6 @@ class NestThermostat(ThermostatDevice):
|
|||||||
return {
|
return {
|
||||||
"humidity": self.device.humidity,
|
"humidity": self.device.humidity,
|
||||||
"target_humidity": self.device.target_humidity,
|
"target_humidity": self.device.target_humidity,
|
||||||
"fan": self.device.fan,
|
|
||||||
"mode": self.device.mode
|
"mode": self.device.mode
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,6 +142,11 @@ class NestThermostat(ThermostatDevice):
|
|||||||
""" Turns away off. """
|
""" Turns away off. """
|
||||||
self.structure.away = False
|
self.structure.away = False
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_fan_on(self):
|
||||||
|
""" Returns whether the fan is on """
|
||||||
|
return self.device.fan
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self):
|
def min_temp(self):
|
||||||
""" Identifies min_temp in Nest API or defaults if not available. """
|
""" Identifies min_temp in Nest API or defaults if not available. """
|
||||||
|
Loading…
x
Reference in New Issue
Block a user