ConfigFlow default discovery without unique ID (#36754)

This commit is contained in:
Franck Nijhof 2020-06-15 13:38:38 +02:00 committed by GitHub
parent dfac9c5e03
commit 3cc94f7d6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 408 additions and 170 deletions

View file

@ -38,22 +38,6 @@ def generate_and_validate(integrations: Dict[str, Integration]):
if not ssdp:
continue
try:
with open(str(integration.path / "config_flow.py")) as fp:
content = fp.read()
if (
" async_step_ssdp" not in content
and "AbstractOAuth2FlowHandler" not in content
and "register_discovery_flow" not in content
):
integration.add_error("ssdp", "Config flow has no async_step_ssdp")
continue
except FileNotFoundError:
integration.add_error(
"ssdp", "SSDP info in a manifest requires a config flow to exist"
)
continue
for matcher in ssdp:
data[domain].append(sort_dict(matcher))