Skip to content

Commit

Permalink
Allow other config
Browse files Browse the repository at this point in the history
  • Loading branch information
palfrey committed Apr 1, 2024
1 parent 65d26b7 commit 970b9d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion custom_components/ban_whitelist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
vol.Required("ip_addresses"): vol.All(cv.ensure_list, [cv.string]),
}
)
}
},
extra=vol.ALLOW_EXTRA,
)


Expand Down
4 changes: 3 additions & 1 deletion stubs/voluptuous.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand All @@ -12,3 +12,5 @@ class All:
def __init__(
self, *args: List[Callable[[Any], Any]] | Callable[[Any], Any]
) -> None: ...

ALLOW_EXTRA: int = ...
2 changes: 1 addition & 1 deletion tests/ban_whitelist/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 970b9d7

Please sign in to comment.