mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Deduplicate blackening (#81802)
This commit is contained in:
@@ -4,20 +4,9 @@ from __future__ import annotations
|
||||
import json
|
||||
import pathlib
|
||||
|
||||
import black
|
||||
|
||||
from .brand import validate as validate_brands
|
||||
from .model import Brand, Config, Integration
|
||||
from .serializer import to_string
|
||||
|
||||
BASE = """
|
||||
\"\"\"Automatically generated by hassfest.
|
||||
|
||||
To update, run python3 -m script.hassfest
|
||||
\"\"\"
|
||||
|
||||
FLOWS = {}
|
||||
""".strip()
|
||||
from .serializer import format_python_namespace
|
||||
|
||||
UNIQUE_ID_IGNORE = {"huawei_lte", "mqtt", "adguard"}
|
||||
|
||||
@@ -91,7 +80,7 @@ def _generate_and_validate(integrations: dict[str, Integration], config: Config)
|
||||
else:
|
||||
domains["integration"].append(domain)
|
||||
|
||||
return black.format_str(BASE.format(to_string(domains)), mode=black.Mode())
|
||||
return format_python_namespace({"FLOWS": domains})
|
||||
|
||||
|
||||
def _populate_brand_integrations(
|
||||
|
||||
Reference in New Issue
Block a user