mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Adjust
This commit is contained in:
parent
3c22b3f676
commit
8842f7a421
@ -36,7 +36,7 @@ class AuthFlowContext(FlowContext, total=False):
|
||||
class AuthFlowResult(FlowResult[AuthFlowContext, tuple[str, str]], total=False):
|
||||
"""Typed result dict for auth flow."""
|
||||
|
||||
result: Credentials
|
||||
result: Credentials # Only present if type is CREATE_ENTRY
|
||||
|
||||
|
||||
@attr.s(slots=True)
|
||||
|
@ -281,6 +281,7 @@ class LoginFlowBaseView(HomeAssistantView):
|
||||
)
|
||||
|
||||
process_success_login(request)
|
||||
# We overwrite the Credentials object with the string code to retrieve it.
|
||||
result["result"] = self._store_result(client_id, result_obj) # type: ignore[typeddict-item]
|
||||
|
||||
return self.json(result)
|
||||
|
@ -146,8 +146,8 @@ def _prepare_config_flow_result_json(
|
||||
return prepare_result_json(result)
|
||||
|
||||
data = result.copy()
|
||||
# FlowManagerIndexView should be a generic class
|
||||
entry: config_entries.ConfigEntry = data["result"] # type: ignore[typeddict-item]
|
||||
# We overwrite the ConfigEntry object with its json representation.
|
||||
data["result"] = entry.as_json_fragment # type: ignore[typeddict-unknown-key]
|
||||
data.pop("data")
|
||||
data.pop("context")
|
||||
|
@ -298,6 +298,7 @@ class ConfigFlowContext(FlowContext, total=False):
|
||||
class ConfigFlowResult(FlowResult[ConfigFlowContext, str], total=False):
|
||||
"""Typed result dict for config flow."""
|
||||
|
||||
# Extra keys, only present if type is CREATE_ENTRY
|
||||
minor_version: int
|
||||
options: Mapping[str, Any]
|
||||
result: ConfigEntry
|
||||
|
Loading…
x
Reference in New Issue
Block a user