mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Allow specifying discovery without a config flow (#54677)
This commit is contained in:
parent
c5d88d3e2f
commit
512a474e93
@ -4,5 +4,10 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/rainforest_eagle",
|
"documentation": "https://www.home-assistant.io/integrations/rainforest_eagle",
|
||||||
"requirements": ["eagle200_reader==0.2.4", "uEagle==0.0.2"],
|
"requirements": ["eagle200_reader==0.2.4", "uEagle==0.0.2"],
|
||||||
"codeowners": ["@gtdiehl", "@jcalbert"],
|
"codeowners": ["@gtdiehl", "@jcalbert"],
|
||||||
"iot_class": "local_polling"
|
"iot_class": "local_polling",
|
||||||
|
"dhcp": [
|
||||||
|
{
|
||||||
|
"macaddress": "D8D5B9*"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -29,31 +29,6 @@ def validate_integration(config: Config, integration: Integration):
|
|||||||
"config_flow",
|
"config_flow",
|
||||||
"Config flows need to be defined in the file config_flow.py",
|
"Config flows need to be defined in the file config_flow.py",
|
||||||
)
|
)
|
||||||
if integration.manifest.get("homekit"):
|
|
||||||
integration.add_error(
|
|
||||||
"config_flow",
|
|
||||||
"HomeKit information in a manifest requires a config flow to exist",
|
|
||||||
)
|
|
||||||
if integration.manifest.get("mqtt"):
|
|
||||||
integration.add_error(
|
|
||||||
"config_flow",
|
|
||||||
"MQTT information in a manifest requires a config flow to exist",
|
|
||||||
)
|
|
||||||
if integration.manifest.get("ssdp"):
|
|
||||||
integration.add_error(
|
|
||||||
"config_flow",
|
|
||||||
"SSDP information in a manifest requires a config flow to exist",
|
|
||||||
)
|
|
||||||
if integration.manifest.get("zeroconf"):
|
|
||||||
integration.add_error(
|
|
||||||
"config_flow",
|
|
||||||
"Zeroconf information in a manifest requires a config flow to exist",
|
|
||||||
)
|
|
||||||
if integration.manifest.get("dhcp"):
|
|
||||||
integration.add_error(
|
|
||||||
"config_flow",
|
|
||||||
"DHCP information in a manifest requires a config flow to exist",
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
config_flow = config_flow_file.read_text()
|
config_flow = config_flow_file.read_text()
|
||||||
@ -98,17 +73,7 @@ def generate_and_validate(integrations: dict[str, Integration], config: Config):
|
|||||||
for domain in sorted(integrations):
|
for domain in sorted(integrations):
|
||||||
integration = integrations[domain]
|
integration = integrations[domain]
|
||||||
|
|
||||||
if not integration.manifest:
|
if not integration.manifest or not integration.config_flow:
|
||||||
continue
|
|
||||||
|
|
||||||
if not (
|
|
||||||
integration.manifest.get("config_flow")
|
|
||||||
or integration.manifest.get("homekit")
|
|
||||||
or integration.manifest.get("mqtt")
|
|
||||||
or integration.manifest.get("ssdp")
|
|
||||||
or integration.manifest.get("zeroconf")
|
|
||||||
or integration.manifest.get("dhcp")
|
|
||||||
):
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
validate_integration(config, integration)
|
validate_integration(config, integration)
|
||||||
|
@ -24,7 +24,7 @@ def generate_and_validate(integrations: list[dict[str, str]]):
|
|||||||
for domain in sorted(integrations):
|
for domain in sorted(integrations):
|
||||||
integration = integrations[domain]
|
integration = integrations[domain]
|
||||||
|
|
||||||
if not integration.manifest:
|
if not integration.manifest or not integration.config_flow:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
match_types = integration.manifest.get("dhcp", [])
|
match_types = integration.manifest.get("dhcp", [])
|
||||||
|
@ -96,6 +96,11 @@ class Integration:
|
|||||||
"""Return quality scale of the integration."""
|
"""Return quality scale of the integration."""
|
||||||
return self.manifest.get("quality_scale")
|
return self.manifest.get("quality_scale")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def config_flow(self) -> str:
|
||||||
|
"""Return if the integration has a config flow."""
|
||||||
|
return self.manifest.get("config_flow")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def requirements(self) -> list[str]:
|
def requirements(self) -> list[str]:
|
||||||
"""List of requirements."""
|
"""List of requirements."""
|
||||||
|
@ -26,7 +26,7 @@ def generate_and_validate(integrations: dict[str, Integration]):
|
|||||||
for domain in sorted(integrations):
|
for domain in sorted(integrations):
|
||||||
integration = integrations[domain]
|
integration = integrations[domain]
|
||||||
|
|
||||||
if not integration.manifest:
|
if not integration.manifest or not integration.config_flow:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
mqtt = integration.manifest.get("mqtt")
|
mqtt = integration.manifest.get("mqtt")
|
||||||
|
@ -31,7 +31,7 @@ def generate_and_validate(integrations: dict[str, Integration]):
|
|||||||
for domain in sorted(integrations):
|
for domain in sorted(integrations):
|
||||||
integration = integrations[domain]
|
integration = integrations[domain]
|
||||||
|
|
||||||
if not integration.manifest:
|
if not integration.manifest or not integration.config_flow:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
ssdp = integration.manifest.get("ssdp")
|
ssdp = integration.manifest.get("ssdp")
|
||||||
|
@ -28,7 +28,7 @@ def generate_and_validate(integrations: dict[str, Integration]):
|
|||||||
for domain in sorted(integrations):
|
for domain in sorted(integrations):
|
||||||
integration = integrations[domain]
|
integration = integrations[domain]
|
||||||
|
|
||||||
if not integration.manifest:
|
if not integration.manifest or not integration.config_flow:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
service_types = integration.manifest.get("zeroconf", [])
|
service_types = integration.manifest.get("zeroconf", [])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user