1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Validate Number value before calling entity method (#52343)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Jan Bouwhuis
2021-08-04 11:57:26 +02:00
committed by GitHub
parent af38ff1ec1
commit 8f014361d4
5 changed files with 119 additions and 16 deletions

View File

@@ -67,7 +67,7 @@ async def test_set_value_bad_range(hass):
state = hass.states.get(ENTITY_VOLUME)
assert state.state == "42.0"
with pytest.raises(vol.Invalid):
with pytest.raises(ValueError):
await hass.services.async_call(
DOMAIN,
SERVICE_SET_VALUE,