mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Mark config flow fields as required (#51898)
* flo * goalzero * mutesync * ring * roon * risco * Ruckus Unleashed * Scaffold template
This commit is contained in:
parent
3488b78365
commit
63e20f2ced
@ -9,7 +9,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
||||
from .const import DOMAIN, LOGGER
|
||||
|
||||
DATA_SCHEMA = vol.Schema({"username": str, "password": str})
|
||||
DATA_SCHEMA = vol.Schema({vol.Required("username"): str, vol.Required("password"): str})
|
||||
|
||||
|
||||
async def validate_input(hass: core.HomeAssistant, data):
|
||||
|
@ -18,7 +18,7 @@ from .const import DEFAULT_NAME, DOMAIN
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DATA_SCHEMA = vol.Schema({"host": str, "name": str})
|
||||
DATA_SCHEMA = vol.Schema({vol.Required("host"): str, vol.Required("name"): str})
|
||||
|
||||
|
||||
class GoalZeroFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
|
@ -16,7 +16,7 @@ from homeassistant.exceptions import HomeAssistantError
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
STEP_USER_DATA_SCHEMA = vol.Schema({"host": str})
|
||||
STEP_USER_DATA_SCHEMA = vol.Schema({vol.Required("host"): str})
|
||||
|
||||
|
||||
async def validate_input(hass: HomeAssistant, data: dict[str, Any]) -> dict[str, Any]:
|
||||
|
@ -64,7 +64,9 @@ class RingConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="user",
|
||||
data_schema=vol.Schema({"username": str, "password": str}),
|
||||
data_schema=vol.Schema(
|
||||
{vol.Required("username"): str, vol.Required("password"): str}
|
||||
),
|
||||
errors=errors,
|
||||
)
|
||||
|
||||
@ -75,7 +77,7 @@ class RingConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="2fa",
|
||||
data_schema=vol.Schema({"2fa": str}),
|
||||
data_schema=vol.Schema({vol.Required("2fa"): str}),
|
||||
)
|
||||
|
||||
|
||||
|
@ -30,7 +30,13 @@ from .const import (
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
DATA_SCHEMA = vol.Schema({CONF_USERNAME: str, CONF_PASSWORD: str, CONF_PIN: str})
|
||||
DATA_SCHEMA = vol.Schema(
|
||||
{
|
||||
vol.Required(CONF_USERNAME): str,
|
||||
vol.Required(CONF_PASSWORD): str,
|
||||
vol.Required(CONF_PIN): str,
|
||||
}
|
||||
)
|
||||
HA_STATES = [
|
||||
STATE_ALARM_ARMED_AWAY,
|
||||
STATE_ALARM_ARMED_HOME,
|
||||
|
@ -18,7 +18,7 @@ from .const import (
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DATA_SCHEMA = vol.Schema({"host": str})
|
||||
DATA_SCHEMA = vol.Schema({vol.Required("host"): str})
|
||||
|
||||
TIMEOUT = 120
|
||||
|
||||
|
@ -12,7 +12,13 @@ from .const import API_SERIAL, API_SYSTEM_OVERVIEW, DOMAIN
|
||||
|
||||
_LOGGER = logging.getLogger(__package__)
|
||||
|
||||
DATA_SCHEMA = vol.Schema({"host": str, "username": str, "password": str})
|
||||
DATA_SCHEMA = vol.Schema(
|
||||
{
|
||||
vol.Required("host"): str,
|
||||
vol.Required("username"): str,
|
||||
vol.Required("password"): str,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def validate_input(hass: core.HomeAssistant, data):
|
||||
|
@ -16,7 +16,13 @@ from .const import DOMAIN
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
# TODO adjust the data schema to the data that you need
|
||||
STEP_USER_DATA_SCHEMA = vol.Schema({"host": str, "username": str, "password": str})
|
||||
STEP_USER_DATA_SCHEMA = vol.Schema(
|
||||
{
|
||||
vol.Required("host"): str,
|
||||
vol.Required("username"): str,
|
||||
vol.Required("password"): str,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class PlaceholderHub:
|
||||
|
Loading…
x
Reference in New Issue
Block a user