1 """Config flow for Wake on lan integration."""
3 from collections.abc
import Mapping
6 import voluptuous
as vol
11 SchemaCommonFlowHandler,
12 SchemaConfigFlowHandler,
22 from .const
import DEFAULT_NAME, DOMAIN
26 handler: SchemaCommonFlowHandler, user_input: dict[str, Any]
28 """Validate input setup."""
31 user_input[CONF_MAC] = dr.format_mac(user_input[CONF_MAC])
34 handler.parent_handler._async_abort_entries_match({CONF_MAC: user_input[CONF_MAC]})
40 handler: SchemaCommonFlowHandler, user_input: dict[str, Any]
42 """Validate input options."""
43 if CONF_BROADCAST_PORT
in user_input:
45 user_input[CONF_BROADCAST_PORT] =
int(user_input[CONF_BROADCAST_PORT])
60 schema=vol.Schema(DATA_SCHEMA).extend(OPTIONS_SCHEMA),
61 validate_user_input=validate,
66 vol.Schema(OPTIONS_SCHEMA), validate_user_input=validate_options
72 """Handle a config flow for Wake on Lan."""
74 config_flow = CONFIG_FLOW
75 options_flow = OPTIONS_FLOW
78 """Return config entry title."""
79 mac: str = options[CONF_MAC]
80 return f
"{DEFAULT_NAME} {mac}"
str async_config_entry_title(self, Mapping[str, Any] options)
dict[str, Any] validate_options(SchemaCommonFlowHandler handler, dict[str, Any] user_input)
dict[str, Any] validate(SchemaCommonFlowHandler handler, dict[str, Any] user_input)