mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-23 09:16:32 +00:00
Update data_entry_flow_index.md (#408)
It seems the code has moved to async_create_entry() but the docs have not. Changes all listings of create_entry() to async_create_entry()
This commit is contained in:
parent
b832ad89c6
commit
9b8a18d1b2
@ -132,7 +132,7 @@ class ExampleConfigFlow(data_entry_flow.FlowHandler):
|
|||||||
valid = await is_valid(user_input)
|
valid = await is_valid(user_input)
|
||||||
if valid:
|
if valid:
|
||||||
# See next section on create entry usage
|
# See next section on create entry usage
|
||||||
return self.create_entry(...)
|
return self.async_create_entry(...)
|
||||||
|
|
||||||
errors["base"] = "auth_error"
|
errors["base"] = "auth_error"
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ When the result is "Create Entry", an entry will be created and passed to the pa
|
|||||||
```python
|
```python
|
||||||
class ExampleConfigFlow(data_entry_flow.FlowHandler):
|
class ExampleConfigFlow(data_entry_flow.FlowHandler):
|
||||||
async def async_step_user(self, user_input=None):
|
async def async_step_user(self, user_input=None):
|
||||||
return self.create_entry(
|
return self.async_create_entry(
|
||||||
title="Title of the entry",
|
title="Title of the entry",
|
||||||
data={
|
data={
|
||||||
"something_special": user_input["username"]
|
"something_special": user_input["username"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user