mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Update typing 16 (#48087)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
"""Generate zeroconf file."""
|
||||
from __future__ import annotations
|
||||
|
||||
from collections import OrderedDict, defaultdict
|
||||
import json
|
||||
from typing import Dict
|
||||
|
||||
from .model import Config, Integration
|
||||
|
||||
@@ -19,7 +20,7 @@ HOMEKIT = {}
|
||||
""".strip()
|
||||
|
||||
|
||||
def generate_and_validate(integrations: Dict[str, Integration]):
|
||||
def generate_and_validate(integrations: dict[str, Integration]):
|
||||
"""Validate and generate zeroconf data."""
|
||||
service_type_dict = defaultdict(list)
|
||||
homekit_dict = {}
|
||||
@@ -89,7 +90,7 @@ def generate_and_validate(integrations: Dict[str, Integration]):
|
||||
return BASE.format(json.dumps(zeroconf, indent=4), json.dumps(homekit, indent=4))
|
||||
|
||||
|
||||
def validate(integrations: Dict[str, Integration], config: Config):
|
||||
def validate(integrations: dict[str, Integration], config: Config):
|
||||
"""Validate zeroconf file."""
|
||||
zeroconf_path = config.root / "homeassistant/generated/zeroconf.py"
|
||||
config.cache["zeroconf"] = content = generate_and_validate(integrations)
|
||||
@@ -108,7 +109,7 @@ def validate(integrations: Dict[str, Integration], config: Config):
|
||||
return
|
||||
|
||||
|
||||
def generate(integrations: Dict[str, Integration], config: Config):
|
||||
def generate(integrations: dict[str, Integration], config: Config):
|
||||
"""Generate zeroconf file."""
|
||||
zeroconf_path = config.root / "homeassistant/generated/zeroconf.py"
|
||||
with open(str(zeroconf_path), "w") as fp:
|
||||
|
||||
Reference in New Issue
Block a user