coerce number selector values to int (#69059)
parent
4a921ac67f
commit
2733600755
|
@ -65,7 +65,10 @@ CONF_KNX_LABEL_TUNNELING_UDP_ROUTE_BACK: Final = "UDP with route back / NAT mode
|
||||||
|
|
||||||
_IA_SELECTOR = selector.selector({"text": {}})
|
_IA_SELECTOR = selector.selector({"text": {}})
|
||||||
_IP_SELECTOR = selector.selector({"text": {}})
|
_IP_SELECTOR = selector.selector({"text": {}})
|
||||||
_PORT_SELECTOR = selector.selector({"number": {"min": 1, "max": 65535, "mode": "box"}})
|
_PORT_SELECTOR = vol.All(
|
||||||
|
selector.selector({"number": {"min": 1, "max": 65535, "mode": "box"}}),
|
||||||
|
vol.Coerce(int),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
@ -246,8 +249,9 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
)
|
)
|
||||||
|
|
||||||
fields = {
|
fields = {
|
||||||
vol.Required(CONF_KNX_SECURE_USER_ID, default=2): selector.selector(
|
vol.Required(CONF_KNX_SECURE_USER_ID, default=2): vol.All(
|
||||||
{"number": {"min": 1, "max": 127, "mode": "box"}}
|
selector.selector({"number": {"min": 1, "max": 127, "mode": "box"}}),
|
||||||
|
vol.Coerce(int),
|
||||||
),
|
),
|
||||||
vol.Required(CONF_KNX_SECURE_USER_PASSWORD): selector.selector(
|
vol.Required(CONF_KNX_SECURE_USER_PASSWORD): selector.selector(
|
||||||
{"text": {"type": "password"}}
|
{"text": {"type": "password"}}
|
||||||
|
@ -421,14 +425,17 @@ class KNXOptionsFlowHandler(OptionsFlow):
|
||||||
CONF_KNX_DEFAULT_RATE_LIMIT,
|
CONF_KNX_DEFAULT_RATE_LIMIT,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
] = selector.selector(
|
] = vol.All(
|
||||||
{
|
selector.selector(
|
||||||
"number": {
|
{
|
||||||
"min": 1,
|
"number": {
|
||||||
"max": CONF_MAX_RATE_LIMIT,
|
"min": 1,
|
||||||
"mode": "box",
|
"max": CONF_MAX_RATE_LIMIT,
|
||||||
|
"mode": "box",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
),
|
||||||
|
vol.Coerce(int),
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.async_show_form(
|
return self.async_show_form(
|
||||||
|
|
Loading…
Reference in New Issue