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

Classes

class  ConfigFlowHandler
 

Functions

dict[str, Any] _validate_mode (SchemaCommonFlowHandler handler, dict[str, Any] user_input)
 
None ws_start_preview (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg)
 

Variables

dictionary CONFIG_FLOW
 
 CONFIG_SCHEMA
 
dictionary OPTIONS_FLOW
 
 OPTIONS_SCHEMA
 

Detailed Description

Config flow for Threshold integration.

Function Documentation

◆ _validate_mode()

dict[str, Any] homeassistant.components.threshold.config_flow._validate_mode ( SchemaCommonFlowHandler  handler,
dict[str, Any]   user_input 
)
private
Validate the threshold mode, and set limits to None if not set.

Definition at line 27 of file config_flow.py.

◆ ws_start_preview()

None homeassistant.components.threshold.config_flow.ws_start_preview ( HomeAssistant  hass,
websocket_api.ActiveConnection  connection,
dict[str, Any]  msg 
)
Generate a preview.

Definition at line 106 of file config_flow.py.

Variable Documentation

◆ CONFIG_FLOW

dictionary homeassistant.components.threshold.config_flow.CONFIG_FLOW
Initial value:
1 = {
2  "user": SchemaFlowFormStep(
3  CONFIG_SCHEMA, preview="threshold", validate_user_input=_validate_mode
4  )
5 }

Definition at line 67 of file config_flow.py.

◆ CONFIG_SCHEMA

homeassistant.components.threshold.config_flow.CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_NAME): selector.TextSelector(),
4  }
5 ).extend(OPTIONS_SCHEMA.schema)

Definition at line 61 of file config_flow.py.

◆ OPTIONS_FLOW

dictionary homeassistant.components.threshold.config_flow.OPTIONS_FLOW
Initial value:
1 = {
2  "init": SchemaFlowFormStep(
3  OPTIONS_SCHEMA, preview="threshold", validate_user_input=_validate_mode
4  )
5 }

Definition at line 73 of file config_flow.py.

◆ OPTIONS_SCHEMA

homeassistant.components.threshold.config_flow.OPTIONS_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(
4  CONF_HYSTERESIS, default=DEFAULT_HYSTERESIS
5  ): selector.NumberSelector(
6  selector.NumberSelectorConfig(
7  mode=selector.NumberSelectorMode.BOX, step="any"
8  ),
9  ),
10  vol.Optional(CONF_LOWER): selector.NumberSelector(
11  selector.NumberSelectorConfig(
12  mode=selector.NumberSelectorMode.BOX, step="any"
13  ),
14  ),
15  vol.Optional(CONF_UPPER): selector.NumberSelector(
16  selector.NumberSelectorConfig(
17  mode=selector.NumberSelectorMode.BOX, step="any"
18  ),
19  ),
20  vol.Required(CONF_ENTITY_ID): selector.EntitySelector(
21  selector.EntitySelectorConfig(domain=SENSOR_DOMAIN)
22  ),
23  }
24 )

Definition at line 36 of file config_flow.py.