Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.worldclock.config_flow Namespace Reference

Classes

class  WorldclockConfigFlowHandler
 

Functions

vol.Schema get_schema (SchemaCommonFlowHandler handler)
 
dict[str, Any] validate_duplicate (SchemaCommonFlowHandler handler, dict[str, Any] user_input)
 

Variables

dictionary CONFIG_FLOW
 
 DATA_SCHEMA_OPTIONS
 
dictionary OPTIONS_FLOW
 
list TIME_STR_OPTIONS
 

Detailed Description

Config flow for World clock.

Function Documentation

◆ get_schema()

vol.Schema homeassistant.components.worldclock.config_flow.get_schema ( SchemaCommonFlowHandler  handler)
Get available timezones.

Definition at line 49 of file config_flow.py.

◆ validate_duplicate()

dict[str, Any] homeassistant.components.worldclock.config_flow.validate_duplicate ( SchemaCommonFlowHandler  handler,
dict[str, Any]   user_input 
)
Validate already existing entry.

Definition at line 40 of file config_flow.py.

Variable Documentation

◆ CONFIG_FLOW

dictionary homeassistant.components.worldclock.config_flow.CONFIG_FLOW
Initial value:
1 = {
2  "user": SchemaFlowFormStep(
3  schema=get_schema,
4  validate_user_input=validate_duplicate,
5  ),
6  "import": SchemaFlowFormStep(
7  schema=get_schema,
8  validate_user_input=validate_duplicate,
9  ),
10 }

Definition at line 81 of file config_flow.py.

◆ DATA_SCHEMA_OPTIONS

homeassistant.components.worldclock.config_flow.DATA_SCHEMA_OPTIONS
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(CONF_TIME_FORMAT, default=DEFAULT_TIME_STR_FORMAT): SelectSelector(
4  SelectSelectorConfig(
5  options=TIME_STR_OPTIONS,
6  custom_value=True,
7  mode=SelectSelectorMode.DROPDOWN,
8  )
9  )
10  }
11 )

Definition at line 68 of file config_flow.py.

◆ OPTIONS_FLOW

dictionary homeassistant.components.worldclock.config_flow.OPTIONS_FLOW
Initial value:
1 = {
2  "init": SchemaFlowFormStep(
3  DATA_SCHEMA_OPTIONS,
4  validate_user_input=validate_duplicate,
5  )
6 }

Definition at line 91 of file config_flow.py.

◆ TIME_STR_OPTIONS

list homeassistant.components.worldclock.config_flow.TIME_STR_OPTIONS
Initial value:
1 = [
2  SelectOptionDict(
3  value=DEFAULT_TIME_STR_FORMAT, label=f"14:05 ({DEFAULT_TIME_STR_FORMAT})"
4  ),
5  SelectOptionDict(value="%I:%M %p", label="11:05 AM (%I:%M %p)"),
6  SelectOptionDict(value="%Y-%m-%d %H:%M", label="2024-01-01 14:05 (%Y-%m-%d %H:%M)"),
7  SelectOptionDict(
8  value="%a, %b %d, %Y %I:%M %p",
9  label="Mon, Jan 01, 2024 11:05 AM (%a, %b %d, %Y %I:%M %p)",
10  ),
11 ]

Definition at line 27 of file config_flow.py.