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

@ -11,6 +11,7 @@ from homeassistant.components.select import (
)
from homeassistant.const import ATTR_ENTITY_ID, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ServiceValidationError
from homeassistant.setup import async_setup_component
ENTITY_SPEED = "select.speed"
@ -51,7 +52,7 @@ async def test_select_option_bad_attr(hass: HomeAssistant) -> None:
assert state
assert state.state == "ridiculous_speed"
with pytest.raises(ValueError):
with pytest.raises(ServiceValidationError):
await hass.services.async_call(
DOMAIN,
SERVICE_SELECT_OPTION,