mirror of
https://github.com/home-assistant/core.git
synced 2026-10-06 14:29:21 -04:00
Use TextSelectors in Samsung TV (#184020)
This commit is contained in:
@@ -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")
|
||||
)
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user