mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Fix Elk-M1 missing TLS 1.2 check (#140672)
* Fix for missing TLS 1.2 check * Fix error message. * combine startswith --------- Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
85b6b3a360
commit
c9ceade10d
@ -101,9 +101,11 @@ def hostname_from_url(url: str) -> str:
|
||||
|
||||
def _host_validator(config: dict[str, str]) -> dict[str, str]:
|
||||
"""Validate that a host is properly configured."""
|
||||
if config[CONF_HOST].startswith("elks://"):
|
||||
if config[CONF_HOST].startswith(("elks://", "elksv1_2://")):
|
||||
if CONF_USERNAME not in config or CONF_PASSWORD not in config:
|
||||
raise vol.Invalid("Specify username and password for elks://")
|
||||
raise vol.Invalid(
|
||||
"Specify username and password for elks:// or elksv1_2://"
|
||||
)
|
||||
elif not config[CONF_HOST].startswith("elk://") and not config[
|
||||
CONF_HOST
|
||||
].startswith("serial://"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user