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

Classes

class  _FlowType
 
class  RandomConfigFlowHandler
 

Functions

vol.Schema _generate_schema (str domain, _FlowType flow_type)
 
None _validate_unit (dict[str, Any] options)
 
str choose_options_step (dict[str, Any] options)
 
Callable[[SchemaCommonFlowHandler, dict[str, Any]], Coroutine[Any, Any, dict[str, Any]],] validate_user_input (str entity_type)
 

Variables

dictionary CONFIG_FLOW
 
dictionary OPTIONS_FLOW
 
list RANDOM_TYPES
 

Detailed Description

Config flow for Random helper.

Function Documentation

◆ _generate_schema()

vol.Schema homeassistant.components.random.config_flow._generate_schema ( str  domain,
_FlowType  flow_type 
)
private
Generate schema.

Definition at line 43 of file config_flow.py.

◆ _validate_unit()

None homeassistant.components.random.config_flow._validate_unit ( dict[str, Any]  options)
private
Validate unit of measurement.

Definition at line 102 of file config_flow.py.

◆ choose_options_step()

str homeassistant.components.random.config_flow.choose_options_step ( dict[str, Any]  options)
Return next step_id for options flow according to entity_type.

Definition at line 97 of file config_flow.py.

◆ validate_user_input()

Callable[ [SchemaCommonFlowHandler, dict[str, Any]], Coroutine[Any, Any, dict[str, Any]], ] homeassistant.components.random.config_flow.validate_user_input ( str  entity_type)
Do post validation of user input.

For sensors: Validate unit of measurement.

Definition at line 124 of file config_flow.py.

Variable Documentation

◆ CONFIG_FLOW

dictionary homeassistant.components.random.config_flow.CONFIG_FLOW
Initial value:
1 = {
2  "user": SchemaFlowMenuStep(RANDOM_TYPES),
3  Platform.BINARY_SENSOR: SchemaFlowFormStep(
4  _generate_schema(Platform.BINARY_SENSOR, _FlowType.CONFIG),
5  validate_user_input=validate_user_input(Platform.BINARY_SENSOR),
6  ),
7  Platform.SENSOR: SchemaFlowFormStep(
8  _generate_schema(Platform.SENSOR, _FlowType.CONFIG),
9  validate_user_input=validate_user_input(Platform.SENSOR),
10  ),
11 }
vol.Schema _generate_schema(str domain, _FlowType flow_type)
Definition: config_flow.py:43
dict[str, Any] validate_user_input(SchemaCommonFlowHandler handler, dict[str, Any] user_input)
Definition: config_flow.py:35

Definition at line 152 of file config_flow.py.

◆ OPTIONS_FLOW

dictionary homeassistant.components.random.config_flow.OPTIONS_FLOW
Initial value:
1 = {
2  "init": SchemaFlowFormStep(next_step=choose_options_step),
3  Platform.BINARY_SENSOR: SchemaFlowFormStep(
4  _generate_schema(Platform.BINARY_SENSOR, _FlowType.OPTION),
5  validate_user_input=validate_user_input(Platform.BINARY_SENSOR),
6  ),
7  Platform.SENSOR: SchemaFlowFormStep(
8  _generate_schema(Platform.SENSOR, _FlowType.OPTION),
9  validate_user_input=validate_user_input(Platform.SENSOR),
10  ),
11 }

Definition at line 165 of file config_flow.py.

◆ RANDOM_TYPES

list homeassistant.components.random.config_flow.RANDOM_TYPES
Initial value:
1 = [
2  Platform.BINARY_SENSOR.value,
3  Platform.SENSOR.value,
4 ]

Definition at line 147 of file config_flow.py.