mirror of
https://github.com/home-assistant/core
synced 2024-08-02 23:40:32 +02:00
Fix implicit Optional [core] (#76719)
This commit is contained in:
parent
a70252a243
commit
cf7c716bda
@ -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:
|
||||
|
@ -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)
|
||||
|
@ -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."""
|
||||
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user