From f58a6fa2cb0e9666b68b078ef08a7d1ecf2cd44c Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Fri, 22 Nov 2024 13:20:32 +0100 Subject: [PATCH] Use TextSelector in SABnzbd config flow (#131255) --- homeassistant/components/sabnzbd/config_flow.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sabnzbd/config_flow.py b/homeassistant/components/sabnzbd/config_flow.py index b3bf48a252b..c52572ed762 100644 --- a/homeassistant/components/sabnzbd/config_flow.py +++ b/homeassistant/components/sabnzbd/config_flow.py @@ -9,6 +9,11 @@ import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_API_KEY, CONF_URL +from homeassistant.helpers.selector import ( + TextSelector, + TextSelectorConfig, + TextSelectorType, +) from .const import DOMAIN from .sab import get_client @@ -17,8 +22,16 @@ _LOGGER = logging.getLogger(__name__) USER_SCHEMA = vol.Schema( { - vol.Required(CONF_API_KEY): str, - vol.Required(CONF_URL): str, + vol.Required(CONF_URL): TextSelector( + TextSelectorConfig( + type=TextSelectorType.URL, + ) + ), + vol.Required(CONF_API_KEY): TextSelector( + TextSelectorConfig( + type=TextSelectorType.PASSWORD, + ) + ), } )