diff --git a/custom_components/ban_whitelist/__init__.py b/custom_components/ban_whitelist/__init__.py index 07a5eba..9f7d032 100644 --- a/custom_components/ban_whitelist/__init__.py +++ b/custom_components/ban_whitelist/__init__.py @@ -23,7 +23,8 @@ vol.Required("ip_addresses"): vol.All(cv.ensure_list, [cv.string]), } ) - } + }, + extra=vol.ALLOW_EXTRA, ) diff --git a/stubs/voluptuous.pyi b/stubs/voluptuous.pyi index 5603247..a67a9e9 100644 --- a/stubs/voluptuous.pyi +++ b/stubs/voluptuous.pyi @@ -3,7 +3,7 @@ from typing import Any, Callable, List class Schema: - def __init__(self, config: dict) -> None: ... + def __init__(self, config: dict, extra: int | None = None) -> None: ... class Required: def __init__(self, name: str) -> None: ... @@ -12,3 +12,5 @@ class All: def __init__( self, *args: List[Callable[[Any], Any]] | Callable[[Any], Any] ) -> None: ... + +ALLOW_EXTRA: int = ... diff --git a/tests/ban_whitelist/test_setup.py b/tests/ban_whitelist/test_setup.py index 315fb52..468ec22 100644 --- a/tests/ban_whitelist/test_setup.py +++ b/tests/ban_whitelist/test_setup.py @@ -17,7 +17,7 @@ async def test_setup(hass: HomeAssistant, caplog: pytest.LogCaptureFixture) -> N assert list((await async_get_custom_components(hass)).keys()) == ["ban_whitelist"] await async_setup_component(hass, "http", {}) await async_setup_component( - hass, DOMAIN, {DOMAIN: {"ip_addresses": ["192.168.1.1"]}} + hass, DOMAIN, {DOMAIN: {"ip_addresses": ["192.168.1.1"]}, "foo": "bar"} ) for record in caplog.records: