1
mirror of https://github.com/home-assistant/core synced 2024-07-12 07:21:24 +02:00

Fix implicit Optional [core] (#76719)

This commit is contained in:
Marc Mueller 2022-08-13 18:46:08 +02:00 committed by GitHub
parent a70252a243
commit cf7c716bda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -168,7 +168,7 @@ async def async_import_client_credential(
hass: HomeAssistant,
domain: str,
credential: ClientCredential,
auth_domain: str = None,
auth_domain: str | None = None,
) -> None:
"""Import an existing credential from configuration.yaml."""
if DOMAIN not in hass.data:

View File

@ -117,7 +117,7 @@ def registration_context(registration: dict) -> Context:
def empty_okay_response(
headers: dict = None, status: HTTPStatus = HTTPStatus.OK
headers: dict | None = None, status: HTTPStatus = HTTPStatus.OK
) -> Response:
"""Return a Response with empty JSON object and a 200."""
return Response(
@ -129,7 +129,7 @@ def error_response(
code: str,
message: str,
status: HTTPStatus = HTTPStatus.BAD_REQUEST,
headers: dict = None,
headers: dict | None = None,
) -> Response:
"""Return an error Response."""
return json_response(
@ -177,7 +177,7 @@ def webhook_response(
*,
registration: dict,
status: HTTPStatus = HTTPStatus.OK,
headers: dict = None,
headers: dict | None = None,
) -> Response:
"""Return a encrypted response if registration supports it."""
data = json.dumps(data, cls=JSONEncoder)

View File

@ -287,7 +287,7 @@ async def async_discover_yaml_entities(
async def async_get_platform_config_from_yaml(
hass: HomeAssistant,
platform_domain: str,
config_yaml: ConfigType = None,
config_yaml: ConfigType | None = None,
) -> list[ConfigType]:
"""Return a list of validated configurations for the domain."""

View File

@ -79,7 +79,7 @@ LEGACY_FIELDS = {
def rewrite_common_legacy_to_modern_conf(
entity_cfg: dict[str, Any], extra_legacy_fields: dict[str, str] = None
entity_cfg: dict[str, Any], extra_legacy_fields: dict[str, str] | None = None
) -> dict[str, Any]:
"""Rewrite legacy config."""
entity_cfg = {**entity_cfg}