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

Classes

class  StatisticsConfigFlowHandler
 

Functions

dict[str, Any] validate_options (SchemaCommonFlowHandler handler, dict[str, Any] user_input)
 

Variables

dictionary CONFIG_FLOW
 
 DATA_SCHEMA_OPTIONS
 
 DATA_SCHEMA_SETUP
 
dictionary OPTIONS_FLOW
 

Detailed Description

The history_stats component config flow.

Function Documentation

◆ validate_options()

dict[str, Any] homeassistant.components.history_stats.config_flow.validate_options ( SchemaCommonFlowHandler  handler,
dict[str, Any]   user_input 
)
Validate options selected.

Definition at line 41 of file config_flow.py.

Variable Documentation

◆ CONFIG_FLOW

dictionary homeassistant.components.history_stats.config_flow.CONFIG_FLOW
Initial value:
1 = {
2  "user": SchemaFlowFormStep(
3  schema=DATA_SCHEMA_SETUP,
4  next_step="options",
5  ),
6  "options": SchemaFlowFormStep(
7  schema=DATA_SCHEMA_OPTIONS,
8  validate_user_input=validate_options,
9  ),
10 }

Definition at line 77 of file config_flow.py.

◆ DATA_SCHEMA_OPTIONS

homeassistant.components.history_stats.config_flow.DATA_SCHEMA_OPTIONS
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(CONF_START): TemplateSelector(),
4  vol.Optional(CONF_END): TemplateSelector(),
5  vol.Optional(CONF_DURATION): DurationSelector(
6  DurationSelectorConfig(enable_day=True, allow_negative=False)
7  ),
8  }
9 )

Definition at line 67 of file config_flow.py.

◆ DATA_SCHEMA_SETUP

homeassistant.components.history_stats.config_flow.DATA_SCHEMA_SETUP
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_NAME, default=DEFAULT_NAME): TextSelector(),
4  vol.Required(CONF_ENTITY_ID): EntitySelector(),
5  vol.Required(CONF_STATE): TextSelector(TextSelectorConfig(multiple=True)),
6  vol.Required(CONF_TYPE, default=CONF_TYPE_TIME): SelectSelector(
7  SelectSelectorConfig(
8  options=CONF_TYPE_KEYS,
9  mode=SelectSelectorMode.DROPDOWN,
10  translation_key=CONF_TYPE,
11  )
12  ),
13  }
14 )

Definition at line 53 of file config_flow.py.

◆ OPTIONS_FLOW

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

Definition at line 87 of file config_flow.py.