mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-09 10:26:30 +00:00
Add missing config_entry to OptionsFlowHandler (#1113)
The config_entry needs to be passed to the OptionsFlow Handler in order to be then usable in its method async_step_init.
This commit is contained in:
parent
9b7f099e0e
commit
fcfe383a92
@ -15,7 +15,7 @@ For an integration to support options it needs to have an `async_get_options_flo
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(config_entry):
|
||||||
return OptionsFlowHandler()
|
return OptionsFlowHandler(config_entry)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Flow handler
|
## Flow handler
|
||||||
@ -24,6 +24,10 @@ The Flow handler works just like the config flow handler, except that the first
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
class OptionsFlowHandler(config_entries.OptionsFlow):
|
class OptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
|
def __init__(self, config_entry):
|
||||||
|
"""Initialize options flow."""
|
||||||
|
self.config_entry = config_entry
|
||||||
|
|
||||||
async def async_step_init(self, user_input=None):
|
async def async_step_init(self, user_input=None):
|
||||||
"""Manage the options."""
|
"""Manage the options."""
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user