Raise ServiceValidationError on invalid select option (#106350)

* Raise ServiceValidationError on invalid select option

* Fix tests

* Correct place holders

* More test fixes
This commit is contained in:
Jan Bouwhuis 2023-12-27 09:45:55 +01:00 committed by GitHub
parent fbcb31b103
commit c7eab49c70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 60 additions and 27 deletions

View file

@ -12,6 +12,7 @@ from homeassistant.components.select import (
)
from homeassistant.const import ATTR_ENTITY_ID, EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers import entity_registry as er
from .conftest import setup_integration
@ -59,7 +60,7 @@ async def test_invalid_wait_time_select(hass: HomeAssistant, mock_account) -> No
data = {ATTR_ENTITY_ID: SELECT_ENTITY_ID, ATTR_OPTION: "10"}
with pytest.raises(ValueError):
with pytest.raises(ServiceValidationError):
await hass.services.async_call(
PLATFORM_DOMAIN,
SERVICE_SELECT_OPTION,