mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Minor tweaks of hassfest and loader.py (#78929)
This commit is contained in:
parent
bbe19e6255
commit
27599ea0ee
@ -129,7 +129,7 @@ class Manifest(TypedDict, total=False):
|
||||
name: str
|
||||
disabled: str
|
||||
domain: str
|
||||
integration_type: Literal["integration", "helper"]
|
||||
integration_type: Literal["integration", "hardware", "helper"]
|
||||
dependencies: list[str]
|
||||
after_dependencies: list[str]
|
||||
requirements: list[str]
|
||||
@ -558,7 +558,7 @@ class Integration:
|
||||
return self.manifest.get("iot_class")
|
||||
|
||||
@property
|
||||
def integration_type(self) -> Literal["integration", "helper"]:
|
||||
def integration_type(self) -> Literal["integration", "hardware", "helper"]:
|
||||
"""Return the integration type."""
|
||||
return self.manifest.get("integration_type", "integration")
|
||||
|
||||
|
@ -18,7 +18,7 @@ FLOWS = {}
|
||||
UNIQUE_ID_IGNORE = {"huawei_lte", "mqtt", "adguard"}
|
||||
|
||||
|
||||
def validate_integration(config: Config, integration: Integration):
|
||||
def _validate_integration(config: Config, integration: Integration):
|
||||
"""Validate config flow of an integration."""
|
||||
config_flow_file = integration.path / "config_flow.py"
|
||||
|
||||
@ -67,7 +67,7 @@ def validate_integration(config: Config, integration: Integration):
|
||||
)
|
||||
|
||||
|
||||
def generate_and_validate(integrations: dict[str, Integration], config: Config):
|
||||
def _generate_and_validate(integrations: dict[str, Integration], config: Config):
|
||||
"""Validate and generate config flow data."""
|
||||
domains = {
|
||||
"integration": [],
|
||||
@ -80,7 +80,7 @@ def generate_and_validate(integrations: dict[str, Integration], config: Config):
|
||||
if not integration.manifest or not integration.config_flow:
|
||||
continue
|
||||
|
||||
validate_integration(config, integration)
|
||||
_validate_integration(config, integration)
|
||||
|
||||
domains[integration.integration_type].append(domain)
|
||||
|
||||
@ -90,7 +90,7 @@ def generate_and_validate(integrations: dict[str, Integration], config: Config):
|
||||
def validate(integrations: dict[str, Integration], config: Config):
|
||||
"""Validate config flow file."""
|
||||
config_flow_path = config.root / "homeassistant/generated/config_flows.py"
|
||||
config.cache["config_flow"] = content = generate_and_validate(integrations, config)
|
||||
config.cache["config_flow"] = content = _generate_and_validate(integrations, config)
|
||||
|
||||
if config.specific_integrations:
|
||||
return
|
||||
|
@ -127,7 +127,7 @@ class Integration:
|
||||
self.errors.append(Error(*args, **kwargs))
|
||||
|
||||
def add_warning(self, *args: Any, **kwargs: Any) -> None:
|
||||
"""Add an warning."""
|
||||
"""Add a warning."""
|
||||
self.warnings.append(Error(*args, **kwargs))
|
||||
|
||||
def load_manifest(self) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user