Use TextSelectors in Samsung TV (#184020)

This commit is contained in:
Simone Chemelli
2026-10-02 13:55:53 +02:00
committed by GitHub
parent c4f6318beb
commit 473be3b6c8
@@ -30,6 +30,7 @@ from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, callback
from homeassistant.data_entry_flow import AbortFlow
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.device_registry import format_mac
from homeassistant.helpers.selector import TextSelector, TextSelectorConfig
from homeassistant.helpers.service_info.dhcp import DhcpServiceInfo
from homeassistant.helpers.service_info.ssdp import (
ATTR_UPNP_MANUFACTURER,
@@ -66,7 +67,7 @@ from .const import (
UPNP_SVC_RENDERING_CONTROL,
)
DATA_SCHEMA = probatio.Schema({probatio.Required(CONF_HOST): str})
DATA_SCHEMA = probatio.Schema({probatio.Required(CONF_HOST): TextSelector()})
def _strip_uuid(udn: str) -> str:
@@ -392,7 +393,11 @@ class SamsungTVConfigFlow(ConfigFlow, domain=DOMAIN):
errors=errors,
description_placeholders={"device": self._title},
data_schema=probatio.Schema(
{probatio.Required(probatio.Secret(CONF_PIN)): str}
{
probatio.Required(probatio.Secret(CONF_PIN)): TextSelector(
TextSelectorConfig(autocomplete="one-time-code")
)
}
),
)
@@ -682,6 +687,10 @@ class SamsungTVConfigFlow(ConfigFlow, domain=DOMAIN):
errors=errors,
description_placeholders={"device": reauth_entry.title},
data_schema=probatio.Schema(
{probatio.Required(probatio.Secret(CONF_PIN)): str}
{
probatio.Required(probatio.Secret(CONF_PIN)): TextSelector(
TextSelectorConfig(autocomplete="one-time-code")
)
}
),
)