From 9e49c03b6620cfbf141a5cb52ca87dbd88d3eeb2 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Fri, 2 Oct 2026 13:33:46 +0200 Subject: [PATCH] Use TextSelectors in Alexa Devices (#184032) --- .../components/alexa_devices/config_flow.py | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/alexa_devices/config_flow.py b/homeassistant/components/alexa_devices/config_flow.py index 3ba9abf153ba..19c5a1421222 100644 --- a/homeassistant/components/alexa_devices/config_flow.py +++ b/homeassistant/components/alexa_devices/config_flow.py @@ -18,27 +18,51 @@ from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_CODE, CONF_PASSWORD, CONF_USERNAME from homeassistant.core import HomeAssistant from homeassistant.helpers import aiohttp_client -import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.selector import ( + TextSelector, + TextSelectorConfig, + TextSelectorType, +) from .const import CONF_LOGIN_DATA, DOMAIN STEP_USER_DATA_SCHEMA = probatio.Schema( { - probatio.Required(CONF_USERNAME): cv.string, - probatio.Required(probatio.Secret(CONF_PASSWORD)): cv.string, - probatio.Required(CONF_CODE): cv.string, + probatio.Required(CONF_USERNAME): TextSelector( + TextSelectorConfig(type=TextSelectorType.EMAIL, autocomplete="username") + ), + probatio.Required(probatio.Secret(CONF_PASSWORD)): TextSelector( + TextSelectorConfig( + type=TextSelectorType.PASSWORD, autocomplete="current-password" + ) + ), + probatio.Required(CONF_CODE): TextSelector( + TextSelectorConfig(autocomplete="one-time-code") + ), } ) STEP_REAUTH_DATA_SCHEMA = probatio.Schema( { - probatio.Required(probatio.Secret(CONF_PASSWORD)): cv.string, - probatio.Required(CONF_CODE): cv.string, + probatio.Required(probatio.Secret(CONF_PASSWORD)): TextSelector( + TextSelectorConfig( + type=TextSelectorType.PASSWORD, autocomplete="current-password" + ) + ), + probatio.Required(CONF_CODE): TextSelector( + TextSelectorConfig(autocomplete="one-time-code") + ), } ) STEP_RECONFIGURE = probatio.Schema( { - probatio.Required(probatio.Secret(CONF_PASSWORD)): cv.string, - probatio.Required(CONF_CODE): cv.string, + probatio.Required(probatio.Secret(CONF_PASSWORD)): TextSelector( + TextSelectorConfig( + type=TextSelectorType.PASSWORD, autocomplete="current-password" + ) + ), + probatio.Required(CONF_CODE): TextSelector( + TextSelectorConfig(autocomplete="one-time-code") + ), } )