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:
Marc Hörsken 2021-10-29 19:28:11 +02:00 committed by GitHub
parent 9b7f099e0e
commit fcfe383a92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: