From 5f697494209f0baedd6198bc8645a4a41bc77604 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Wed, 13 Dec 2023 19:39:19 +0100 Subject: [PATCH] Use Textselector in Trafikverket Camera (#105677) * Use Textselector in Trafikverket Camera * Update homeassistant/components/trafikverket_camera/strings.json Co-authored-by: Jan-Philipp Benecke --------- Co-authored-by: Jan-Philipp Benecke --- .../components/trafikverket_camera/config_flow.py | 8 ++++---- homeassistant/components/trafikverket_camera/strings.json | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/trafikverket_camera/config_flow.py b/homeassistant/components/trafikverket_camera/config_flow.py index 104a6a470dc..a5257455e7a 100644 --- a/homeassistant/components/trafikverket_camera/config_flow.py +++ b/homeassistant/components/trafikverket_camera/config_flow.py @@ -17,7 +17,7 @@ from homeassistant import config_entries from homeassistant.const import CONF_API_KEY, CONF_ID, CONF_LOCATION from homeassistant.data_entry_flow import FlowResult from homeassistant.helpers.aiohttp_client import async_get_clientsession -import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.selector import TextSelector from .const import DOMAIN @@ -90,7 +90,7 @@ class TVCameraConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): step_id="reauth_confirm", data_schema=vol.Schema( { - vol.Required(CONF_API_KEY): cv.string, + vol.Required(CONF_API_KEY): TextSelector(), } ), errors=errors, @@ -123,8 +123,8 @@ class TVCameraConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): step_id="user", data_schema=vol.Schema( { - vol.Required(CONF_API_KEY): cv.string, - vol.Required(CONF_LOCATION): cv.string, + vol.Required(CONF_API_KEY): TextSelector(), + vol.Required(CONF_LOCATION): TextSelector(), } ), errors=errors, diff --git a/homeassistant/components/trafikverket_camera/strings.json b/homeassistant/components/trafikverket_camera/strings.json index 651225934cd..35dbbb1f540 100644 --- a/homeassistant/components/trafikverket_camera/strings.json +++ b/homeassistant/components/trafikverket_camera/strings.json @@ -15,6 +15,9 @@ "data": { "api_key": "[%key:common::config_flow::data::api_key%]", "location": "[%key:common::config_flow::data::location%]" + }, + "data_description": { + "location": "Equal or part of name, description or camera id" } } }