Remove use of HVAC_MODE_OFF in plugwise climate, it's not implemented (#69094)
parent
4f49939bc0
commit
9902ecb417
|
@ -12,7 +12,6 @@ from homeassistant.components.climate.const import (
|
|||
HVAC_MODE_AUTO,
|
||||
HVAC_MODE_COOL,
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
SUPPORT_PRESET_MODE,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
)
|
||||
|
@ -64,7 +63,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
|
|||
self._attr_preset_modes = list(presets)
|
||||
|
||||
# Determine hvac modes and current hvac mode
|
||||
self._attr_hvac_modes = [HVAC_MODE_HEAT, HVAC_MODE_OFF]
|
||||
self._attr_hvac_modes = [HVAC_MODE_HEAT]
|
||||
if self.coordinator.data.gateway.get("cooling_present"):
|
||||
self._attr_hvac_modes.append(HVAC_MODE_COOL)
|
||||
if self.device.get("available_schedules") != ["None"]:
|
||||
|
@ -90,7 +89,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
|
|||
def hvac_mode(self) -> str:
|
||||
"""Return HVAC operation ie. heat, cool mode."""
|
||||
if (mode := self.device.get("mode")) is None or mode not in self.hvac_modes:
|
||||
return HVAC_MODE_OFF
|
||||
return HVAC_MODE_HEAT
|
||||
return mode
|
||||
|
||||
@property
|
||||
|
|
|
@ -9,7 +9,6 @@ from homeassistant.components.climate.const import (
|
|||
HVAC_MODE_AUTO,
|
||||
HVAC_MODE_COOL,
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
|
@ -26,7 +25,6 @@ async def test_adam_climate_entity_attributes(
|
|||
assert state
|
||||
assert state.attributes["hvac_modes"] == [
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
HVAC_MODE_AUTO,
|
||||
]
|
||||
|
||||
|
@ -47,7 +45,6 @@ async def test_adam_climate_entity_attributes(
|
|||
|
||||
assert state.attributes["hvac_modes"] == [
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
HVAC_MODE_AUTO,
|
||||
]
|
||||
|
||||
|
@ -161,7 +158,6 @@ async def test_anna_climate_entity_attributes(
|
|||
assert state.state == HVAC_MODE_HEAT
|
||||
assert state.attributes["hvac_modes"] == [
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
HVAC_MODE_COOL,
|
||||
]
|
||||
assert "no_frost" in state.attributes["preset_modes"]
|
||||
|
|
Loading…
Reference in New Issue