mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Ecobee (#3055)
* Added in list for opreation * Added attribute to reflect the old operation * fix humidity
This commit is contained in:
parent
cf9b49ac03
commit
7ceb22a08b
@ -80,6 +80,8 @@ class Thermostat(ClimateDevice):
|
|||||||
self.thermostat_index)
|
self.thermostat_index)
|
||||||
self._name = self.thermostat['name']
|
self._name = self.thermostat['name']
|
||||||
self.hold_temp = hold_temp
|
self.hold_temp = hold_temp
|
||||||
|
self._operation_list = ['auto', 'auxHeatOnly', 'cool',
|
||||||
|
'heat', 'off']
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Get the latest state from the thermostat."""
|
"""Get the latest state from the thermostat."""
|
||||||
@ -124,11 +126,6 @@ class Thermostat(ClimateDevice):
|
|||||||
"""Return the upper bound temperature we try to reach."""
|
"""Return the upper bound temperature we try to reach."""
|
||||||
return int(self.thermostat['runtime']['desiredCool'] / 10)
|
return int(self.thermostat['runtime']['desiredCool'] / 10)
|
||||||
|
|
||||||
@property
|
|
||||||
def current_humidity(self):
|
|
||||||
"""Return the current humidity."""
|
|
||||||
return self.thermostat['runtime']['actualHumidity']
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def desired_fan_mode(self):
|
def desired_fan_mode(self):
|
||||||
"""Return the desired fan mode of operation."""
|
"""Return the desired fan mode of operation."""
|
||||||
@ -147,20 +144,15 @@ class Thermostat(ClimateDevice):
|
|||||||
"""Return current operation."""
|
"""Return current operation."""
|
||||||
return self.operation_mode
|
return self.operation_mode
|
||||||
|
|
||||||
|
@property
|
||||||
|
def operation_list(self):
|
||||||
|
"""Return the operation modes list."""
|
||||||
|
return self._operation_list
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def operation_mode(self):
|
def operation_mode(self):
|
||||||
"""Return current operation ie. heat, cool, idle."""
|
"""Return current operation ie. heat, cool, idle."""
|
||||||
status = self.thermostat['equipmentStatus']
|
return self.thermostat['settings']['hvacMode']
|
||||||
if status == '':
|
|
||||||
return STATE_IDLE
|
|
||||||
elif 'Cool' in status:
|
|
||||||
return STATE_COOL
|
|
||||||
elif 'auxHeat' in status:
|
|
||||||
return STATE_HEAT
|
|
||||||
elif 'heatPump' in status:
|
|
||||||
return STATE_HEAT
|
|
||||||
else:
|
|
||||||
return status
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def mode(self):
|
def mode(self):
|
||||||
@ -176,11 +168,23 @@ class Thermostat(ClimateDevice):
|
|||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return device specific state attributes."""
|
"""Return device specific state attributes."""
|
||||||
# Move these to Thermostat Device and make them global
|
# Move these to Thermostat Device and make them global
|
||||||
|
status = self.thermostat['equipmentStatus']
|
||||||
|
operation = None
|
||||||
|
if status == '':
|
||||||
|
operation = STATE_IDLE
|
||||||
|
elif 'Cool' in status:
|
||||||
|
operation = STATE_COOL
|
||||||
|
elif 'auxHeat' in status:
|
||||||
|
operation = STATE_HEAT
|
||||||
|
elif 'heatPump' in status:
|
||||||
|
operation = STATE_HEAT
|
||||||
|
else:
|
||||||
|
operation = status
|
||||||
return {
|
return {
|
||||||
"humidity": self.current_humidity,
|
"humidity": self.thermostat['runtime']['actualHumidity'],
|
||||||
"fan": self.fan,
|
"fan": self.fan,
|
||||||
"mode": self.mode,
|
"mode": self.mode,
|
||||||
"hvac_mode": self.thermostat['settings']['hvacMode'],
|
"operation": operation,
|
||||||
"fan_min_on_time": self.fan_min_on_time
|
"fan_min_on_time": self.fan_min_on_time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user