diff --git a/homeassistant/components/thermostat/__init__.py b/homeassistant/components/thermostat/__init__.py index dce742b71a8..17b9a2daca6 100644 --- a/homeassistant/components/thermostat/__init__.py +++ b/homeassistant/components/thermostat/__init__.py @@ -34,6 +34,7 @@ STATE_IDLE = "idle" ATTR_CURRENT_TEMPERATURE = "current_temperature" ATTR_AWAY_MODE = "away_mode" +ATTR_FAN = "fan" ATTR_MAX_TEMP = "max_temp" ATTR_MIN_TEMP = "min_temp" ATTR_TEMPERATURE_LOW = "target_temp_low" @@ -167,6 +168,10 @@ class ThermostatDevice(Entity): if is_away is not None: 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 if device_attr is not None: @@ -212,6 +217,14 @@ class ThermostatDevice(Entity): """ 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): """ Set new target temperature. """ pass diff --git a/homeassistant/components/thermostat/nest.py b/homeassistant/components/thermostat/nest.py index 423a3195976..88a7761cb28 100644 --- a/homeassistant/components/thermostat/nest.py +++ b/homeassistant/components/thermostat/nest.py @@ -66,7 +66,6 @@ class NestThermostat(ThermostatDevice): return { "humidity": self.device.humidity, "target_humidity": self.device.target_humidity, - "fan": self.device.fan, "mode": self.device.mode } @@ -143,6 +142,11 @@ class NestThermostat(ThermostatDevice): """ Turns away off. """ self.structure.away = False + @property + def is_fan_on(self): + """ Returns whether the fan is on """ + return self.device.fan + @property def min_temp(self): """ Identifies min_temp in Nest API or defaults if not available. """