From 53da418d686f9adf667604c01737b79d17ac21a5 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Fri, 25 Oct 2024 11:39:45 +0200 Subject: [PATCH] Use NumberSelector in p1_monitor config flow (#128939) --- homeassistant/components/p1_monitor/config_flow.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/p1_monitor/config_flow.py b/homeassistant/components/p1_monitor/config_flow.py index 966fdc350c5..055973e8e37 100644 --- a/homeassistant/components/p1_monitor/config_flow.py +++ b/homeassistant/components/p1_monitor/config_flow.py @@ -10,7 +10,12 @@ import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.helpers.aiohttp_client import async_get_clientsession -from homeassistant.helpers.selector import TextSelector +from homeassistant.helpers.selector import ( + NumberSelector, + NumberSelectorConfig, + NumberSelectorMode, + TextSelector, +) from .const import DOMAIN @@ -52,7 +57,11 @@ class P1MonitorFlowHandler(ConfigFlow, domain=DOMAIN): data_schema=vol.Schema( { vol.Required(CONF_HOST): TextSelector(), - vol.Required(CONF_PORT, default=80): int, + vol.Required(CONF_PORT, default=80): NumberSelector( + NumberSelectorConfig( + mode=NumberSelectorMode.BOX, + ) + ), } ), errors=errors,