mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 14:45:09 +02:00
Remove use of HVAC_MODE_OFF in plugwise climate, it's not implemented (#69094)
This commit is contained in:
@@ -12,7 +12,6 @@ from homeassistant.components.climate.const import (
|
|||||||
HVAC_MODE_AUTO,
|
HVAC_MODE_AUTO,
|
||||||
HVAC_MODE_COOL,
|
HVAC_MODE_COOL,
|
||||||
HVAC_MODE_HEAT,
|
HVAC_MODE_HEAT,
|
||||||
HVAC_MODE_OFF,
|
|
||||||
SUPPORT_PRESET_MODE,
|
SUPPORT_PRESET_MODE,
|
||||||
SUPPORT_TARGET_TEMPERATURE,
|
SUPPORT_TARGET_TEMPERATURE,
|
||||||
)
|
)
|
||||||
@@ -64,7 +63,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
|
|||||||
self._attr_preset_modes = list(presets)
|
self._attr_preset_modes = list(presets)
|
||||||
|
|
||||||
# Determine hvac modes and current hvac mode
|
# 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"):
|
if self.coordinator.data.gateway.get("cooling_present"):
|
||||||
self._attr_hvac_modes.append(HVAC_MODE_COOL)
|
self._attr_hvac_modes.append(HVAC_MODE_COOL)
|
||||||
if self.device.get("available_schedules") != ["None"]:
|
if self.device.get("available_schedules") != ["None"]:
|
||||||
@@ -90,7 +89,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
|
|||||||
def hvac_mode(self) -> str:
|
def hvac_mode(self) -> str:
|
||||||
"""Return HVAC operation ie. heat, cool mode."""
|
"""Return HVAC operation ie. heat, cool mode."""
|
||||||
if (mode := self.device.get("mode")) is None or mode not in self.hvac_modes:
|
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
|
return mode
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@@ -9,7 +9,6 @@ from homeassistant.components.climate.const import (
|
|||||||
HVAC_MODE_AUTO,
|
HVAC_MODE_AUTO,
|
||||||
HVAC_MODE_COOL,
|
HVAC_MODE_COOL,
|
||||||
HVAC_MODE_HEAT,
|
HVAC_MODE_HEAT,
|
||||||
HVAC_MODE_OFF,
|
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
@@ -26,7 +25,6 @@ async def test_adam_climate_entity_attributes(
|
|||||||
assert state
|
assert state
|
||||||
assert state.attributes["hvac_modes"] == [
|
assert state.attributes["hvac_modes"] == [
|
||||||
HVAC_MODE_HEAT,
|
HVAC_MODE_HEAT,
|
||||||
HVAC_MODE_OFF,
|
|
||||||
HVAC_MODE_AUTO,
|
HVAC_MODE_AUTO,
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -47,7 +45,6 @@ async def test_adam_climate_entity_attributes(
|
|||||||
|
|
||||||
assert state.attributes["hvac_modes"] == [
|
assert state.attributes["hvac_modes"] == [
|
||||||
HVAC_MODE_HEAT,
|
HVAC_MODE_HEAT,
|
||||||
HVAC_MODE_OFF,
|
|
||||||
HVAC_MODE_AUTO,
|
HVAC_MODE_AUTO,
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -161,7 +158,6 @@ async def test_anna_climate_entity_attributes(
|
|||||||
assert state.state == HVAC_MODE_HEAT
|
assert state.state == HVAC_MODE_HEAT
|
||||||
assert state.attributes["hvac_modes"] == [
|
assert state.attributes["hvac_modes"] == [
|
||||||
HVAC_MODE_HEAT,
|
HVAC_MODE_HEAT,
|
||||||
HVAC_MODE_OFF,
|
|
||||||
HVAC_MODE_COOL,
|
HVAC_MODE_COOL,
|
||||||
]
|
]
|
||||||
assert "no_frost" in state.attributes["preset_modes"]
|
assert "no_frost" in state.attributes["preset_modes"]
|
||||||
|
Reference in New Issue
Block a user