mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Clean up input-datetime (#16000)
This commit is contained in:
@@ -60,21 +60,6 @@ def has_at_least_one_key(*keys: str) -> Callable:
|
||||
return validate
|
||||
|
||||
|
||||
def has_at_least_one_key_value(*items: list) -> Callable:
|
||||
"""Validate that at least one (key, value) pair exists."""
|
||||
def validate(obj: Dict) -> Dict:
|
||||
"""Test (key,value) exist in dict."""
|
||||
if not isinstance(obj, dict):
|
||||
raise vol.Invalid('expected dictionary')
|
||||
|
||||
for item in obj.items():
|
||||
if item in items:
|
||||
return obj
|
||||
raise vol.Invalid('must contain one of {}.'.format(str(items)))
|
||||
|
||||
return validate
|
||||
|
||||
|
||||
def boolean(value: Any) -> bool:
|
||||
"""Validate and coerce a boolean value."""
|
||||
if isinstance(value, str):
|
||||
|
||||
Reference in New Issue
Block a user