mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Fix ecobee preset and add climate mode back (#25970)
* Fix ecobee preset and add climate mode back * Fix test
This commit is contained in:
parent
90d493a51a
commit
23f26712f0
@ -304,7 +304,7 @@ class Thermostat(ClimateDevice):
|
|||||||
self.vacation = event["name"]
|
self.vacation = event["name"]
|
||||||
return PRESET_VACATION
|
return PRESET_VACATION
|
||||||
|
|
||||||
return None
|
return self._preset_modes[self.thermostat["program"]["currentClimateRef"]]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def hvac_mode(self):
|
def hvac_mode(self):
|
||||||
@ -357,6 +357,9 @@ class Thermostat(ClimateDevice):
|
|||||||
status = self.thermostat["equipmentStatus"]
|
status = self.thermostat["equipmentStatus"]
|
||||||
return {
|
return {
|
||||||
"fan": self.fan,
|
"fan": self.fan,
|
||||||
|
"climate_mode": self._preset_modes[
|
||||||
|
self.thermostat["program"]["currentClimateRef"]
|
||||||
|
],
|
||||||
"equipment_running": status,
|
"equipment_running": status,
|
||||||
"fan_min_on_time": self.thermostat["settings"]["fanMinOnTime"],
|
"fan_min_on_time": self.thermostat["settings"]["fanMinOnTime"],
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,7 @@ class TestEcobee(unittest.TestCase):
|
|||||||
self.ecobee["equipmentStatus"] = "heatPump2"
|
self.ecobee["equipmentStatus"] = "heatPump2"
|
||||||
assert {
|
assert {
|
||||||
"fan": "off",
|
"fan": "off",
|
||||||
|
"climate_mode": "Climate1",
|
||||||
"fan_min_on_time": 10,
|
"fan_min_on_time": 10,
|
||||||
"equipment_running": "heatPump2",
|
"equipment_running": "heatPump2",
|
||||||
} == self.thermostat.device_state_attributes
|
} == self.thermostat.device_state_attributes
|
||||||
@ -138,18 +139,21 @@ class TestEcobee(unittest.TestCase):
|
|||||||
self.ecobee["equipmentStatus"] = "auxHeat2"
|
self.ecobee["equipmentStatus"] = "auxHeat2"
|
||||||
assert {
|
assert {
|
||||||
"fan": "off",
|
"fan": "off",
|
||||||
|
"climate_mode": "Climate1",
|
||||||
"fan_min_on_time": 10,
|
"fan_min_on_time": 10,
|
||||||
"equipment_running": "auxHeat2",
|
"equipment_running": "auxHeat2",
|
||||||
} == self.thermostat.device_state_attributes
|
} == self.thermostat.device_state_attributes
|
||||||
self.ecobee["equipmentStatus"] = "compCool1"
|
self.ecobee["equipmentStatus"] = "compCool1"
|
||||||
assert {
|
assert {
|
||||||
"fan": "off",
|
"fan": "off",
|
||||||
|
"climate_mode": "Climate1",
|
||||||
"fan_min_on_time": 10,
|
"fan_min_on_time": 10,
|
||||||
"equipment_running": "compCool1",
|
"equipment_running": "compCool1",
|
||||||
} == self.thermostat.device_state_attributes
|
} == self.thermostat.device_state_attributes
|
||||||
self.ecobee["equipmentStatus"] = ""
|
self.ecobee["equipmentStatus"] = ""
|
||||||
assert {
|
assert {
|
||||||
"fan": "off",
|
"fan": "off",
|
||||||
|
"climate_mode": "Climate1",
|
||||||
"fan_min_on_time": 10,
|
"fan_min_on_time": 10,
|
||||||
"equipment_running": "",
|
"equipment_running": "",
|
||||||
} == self.thermostat.device_state_attributes
|
} == self.thermostat.device_state_attributes
|
||||||
@ -157,6 +161,15 @@ class TestEcobee(unittest.TestCase):
|
|||||||
self.ecobee["equipmentStatus"] = "Unknown"
|
self.ecobee["equipmentStatus"] = "Unknown"
|
||||||
assert {
|
assert {
|
||||||
"fan": "off",
|
"fan": "off",
|
||||||
|
"climate_mode": "Climate1",
|
||||||
|
"fan_min_on_time": 10,
|
||||||
|
"equipment_running": "Unknown",
|
||||||
|
} == self.thermostat.device_state_attributes
|
||||||
|
|
||||||
|
self.ecobee["program"]["currentClimateRef"] = "c2"
|
||||||
|
assert {
|
||||||
|
"fan": "off",
|
||||||
|
"climate_mode": "Climate2",
|
||||||
"fan_min_on_time": 10,
|
"fan_min_on_time": 10,
|
||||||
"equipment_running": "Unknown",
|
"equipment_running": "Unknown",
|
||||||
} == self.thermostat.device_state_attributes
|
} == self.thermostat.device_state_attributes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user