mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 05:20:17 +00:00
Change Climate set temp action for incorrect feature will raise (#126692)
* Change Climate set temp action for incorrect feature will raise * Fix some tests * Fix review comments * Fix tesla_fleet * Fix tests * Fix review comment
This commit is contained in:
@@ -5,6 +5,7 @@ from unittest.mock import patch
|
||||
from pypck.inputs import ModStatusVar, Unknown
|
||||
from pypck.lcn_addr import LcnAddr
|
||||
from pypck.lcn_defs import Var, VarUnit, VarValue
|
||||
import pytest
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
from homeassistant.components.climate import (
|
||||
@@ -25,6 +26,7 @@ from homeassistant.const import (
|
||||
Platform,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import ServiceValidationError
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from .conftest import MockConfigEntry, MockModuleConnection, init_integration
|
||||
@@ -140,16 +142,17 @@ async def test_set_temperature(hass: HomeAssistant, entry: MockConfigEntry) -> N
|
||||
# wrong temperature set via service call with high/low attributes
|
||||
var_abs.return_value = False
|
||||
|
||||
await hass.services.async_call(
|
||||
DOMAIN_CLIMATE,
|
||||
SERVICE_SET_TEMPERATURE,
|
||||
{
|
||||
ATTR_ENTITY_ID: "climate.climate1",
|
||||
ATTR_TARGET_TEMP_LOW: 24.5,
|
||||
ATTR_TARGET_TEMP_HIGH: 25.5,
|
||||
},
|
||||
blocking=True,
|
||||
)
|
||||
with pytest.raises(ServiceValidationError):
|
||||
await hass.services.async_call(
|
||||
DOMAIN_CLIMATE,
|
||||
SERVICE_SET_TEMPERATURE,
|
||||
{
|
||||
ATTR_ENTITY_ID: "climate.climate1",
|
||||
ATTR_TARGET_TEMP_LOW: 24.5,
|
||||
ATTR_TARGET_TEMP_HIGH: 25.5,
|
||||
},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
var_abs.assert_not_awaited()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user