Remove usage of options property in OptionsFlow (part 2) (#129897)

pull/129911/head
epenet 2024-11-05 19:53:05 +01:00 committed by GitHub
parent c54ed53a81
commit 1e42a38473
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 12 deletions

View File

@ -284,8 +284,7 @@ class AxisOptionsFlowHandler(OptionsFlow):
) -> ConfigFlowResult:
"""Manage the Axis device stream options."""
if user_input is not None:
self.options.update(user_input)
return self.async_create_entry(title="", data=self.options)
return self.async_create_entry(data=self.config_entry.options | user_input)
schema = {}

View File

@ -312,8 +312,7 @@ class DeconzOptionsFlowHandler(OptionsFlow):
) -> ConfigFlowResult:
"""Manage the deconz devices options."""
if user_input is not None:
self.options.update(user_input)
return self.async_create_entry(title="", data=self.options)
return self.async_create_entry(data=self.config_entry.options | user_input)
schema_options = {}
for option, default in (

View File

@ -47,8 +47,7 @@ class OptionsFlowHandler(OptionsFlow):
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
"""Manage the options."""
if user_input is not None:
self.options.update(user_input)
return self.async_create_entry(title="", data=self.options)
return self.async_create_entry(data=self.config_entry.options | user_input)
return self.async_show_form(
step_id="init",

View File

@ -68,8 +68,7 @@ class OptionsFlowHandler(OptionsFlow):
) -> ConfigFlowResult:
"""Manage the options."""
if user_input is not None:
self.options.update(user_input)
return await self._update_options()
return self.async_create_entry(data=self.config_entry.options | user_input)
return self.async_show_form(
step_id="options_1",
@ -95,7 +94,3 @@ class OptionsFlowHandler(OptionsFlow):
}
),
)
async def _update_options(self) -> ConfigFlowResult:
"""Update config entry options."""
return self.async_create_entry(title="", data=self.options)