mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 08:07:45 +00:00
Use new helper properties in yeelight options flow (#129791)
This commit is contained in:
parent
4ac35d40cd
commit
365f8046ac
@ -58,9 +58,11 @@ class YeelightConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlowHandler:
|
def async_get_options_flow(
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
) -> OptionsFlowHandler:
|
||||||
"""Return the options flow."""
|
"""Return the options flow."""
|
||||||
return OptionsFlowHandler(config_entry)
|
return OptionsFlowHandler()
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize the config flow."""
|
"""Initialize the config flow."""
|
||||||
@ -296,16 +298,12 @@ class YeelightConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlow):
|
||||||
"""Handle a option flow for Yeelight."""
|
"""Handle a option flow for Yeelight."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
|
||||||
"""Initialize the option flow."""
|
|
||||||
self._config_entry = config_entry
|
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle the initial step."""
|
"""Handle the initial step."""
|
||||||
data = self._config_entry.data
|
data = self.config_entry.data
|
||||||
options = self._config_entry.options
|
options = self.config_entry.options
|
||||||
detected_model = data.get(CONF_DETECTED_MODEL)
|
detected_model = data.get(CONF_DETECTED_MODEL)
|
||||||
model = options[CONF_MODEL] or detected_model
|
model = options[CONF_MODEL] or detected_model
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user