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

Classes

class  ScrapeConfigFlowHandler
 

Functions

dict[str, Any] get_edit_sensor_suggested_values (SchemaCommonFlowHandler handler)
 
vol.Schema get_remove_sensor_schema (SchemaCommonFlowHandler handler)
 
vol.Schema get_select_sensor_schema (SchemaCommonFlowHandler handler)
 
dict[str, Any] validate_remove_sensor (SchemaCommonFlowHandler handler, dict[str, Any] user_input)
 
dict[str, Any] validate_rest_setup (SchemaCommonFlowHandler handler, dict[str, Any] user_input)
 
dict[str, Any] validate_select_sensor (SchemaCommonFlowHandler handler, dict[str, Any] user_input)
 
dict[str, Any] validate_sensor_edit (SchemaCommonFlowHandler handler, dict[str, Any] user_input)
 
dict[str, Any] validate_sensor_setup (SchemaCommonFlowHandler handler, dict[str, Any] user_input)
 

Variables

dictionary CONFIG_FLOW
 
 DATA_SCHEMA_EDIT_SENSOR = vol.Schema(SENSOR_SETUP)
 
 DATA_SCHEMA_RESOURCE = vol.Schema(RESOURCE_SETUP)
 
 DATA_SCHEMA_SENSOR
 
dictionary OPTIONS_FLOW
 
dictionary RESOURCE_SETUP
 
dictionary SENSOR_SETUP
 

Detailed Description

Adds config flow for Scrape integration.

Function Documentation

◆ get_edit_sensor_suggested_values()

dict[str, Any] homeassistant.components.scrape.config_flow.get_edit_sensor_suggested_values ( SchemaCommonFlowHandler  handler)
Return suggested values for sensor editing.

Definition at line 192 of file config_flow.py.

◆ get_remove_sensor_schema()

vol.Schema homeassistant.components.scrape.config_flow.get_remove_sensor_schema ( SchemaCommonFlowHandler  handler)
Return schema for sensor removal.

Definition at line 218 of file config_flow.py.

◆ get_select_sensor_schema()

vol.Schema homeassistant.components.scrape.config_flow.get_select_sensor_schema ( SchemaCommonFlowHandler  handler)
Return schema for selecting a sensor.

Definition at line 178 of file config_flow.py.

◆ validate_remove_sensor()

dict[str, Any] homeassistant.components.scrape.config_flow.validate_remove_sensor ( SchemaCommonFlowHandler  handler,
dict[str, Any]   user_input 
)
Validate remove sensor.

Definition at line 232 of file config_flow.py.

◆ validate_rest_setup()

dict[str, Any] homeassistant.components.scrape.config_flow.validate_rest_setup ( SchemaCommonFlowHandler  handler,
dict[str, Any]   user_input 
)
Validate rest setup.

Definition at line 140 of file config_flow.py.

◆ validate_select_sensor()

dict[str, Any] homeassistant.components.scrape.config_flow.validate_select_sensor ( SchemaCommonFlowHandler  handler,
dict[str, Any]   user_input 
)
Store sensor index in flow state.

Definition at line 170 of file config_flow.py.

◆ validate_sensor_edit()

dict[str, Any] homeassistant.components.scrape.config_flow.validate_sensor_edit ( SchemaCommonFlowHandler  handler,
dict[str, Any]   user_input 
)
Update edited sensor.

Definition at line 200 of file config_flow.py.

◆ validate_sensor_setup()

dict[str, Any] homeassistant.components.scrape.config_flow.validate_sensor_setup ( SchemaCommonFlowHandler  handler,
dict[str, Any]   user_input 
)
Validate sensor input.

Definition at line 156 of file config_flow.py.

Variable Documentation

◆ CONFIG_FLOW

dictionary homeassistant.components.scrape.config_flow.CONFIG_FLOW
Initial value:
1 = {
2  "user": SchemaFlowFormStep(
3  schema=DATA_SCHEMA_RESOURCE,
4  next_step="sensor",
5  validate_user_input=validate_rest_setup,
6  ),
7  "sensor": SchemaFlowFormStep(
8  schema=DATA_SCHEMA_SENSOR,
9  validate_user_input=validate_sensor_setup,
10  ),
11 }

Definition at line 263 of file config_flow.py.

◆ DATA_SCHEMA_EDIT_SENSOR

homeassistant.components.scrape.config_flow.DATA_SCHEMA_EDIT_SENSOR = vol.Schema(SENSOR_SETUP)

Definition at line 255 of file config_flow.py.

◆ DATA_SCHEMA_RESOURCE

homeassistant.components.scrape.config_flow.DATA_SCHEMA_RESOURCE = vol.Schema(RESOURCE_SETUP)

Definition at line 254 of file config_flow.py.

◆ DATA_SCHEMA_SENSOR

homeassistant.components.scrape.config_flow.DATA_SCHEMA_SENSOR
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(CONF_NAME, default=DEFAULT_NAME): TextSelector(),
4  **SENSOR_SETUP,
5  }
6 )

Definition at line 256 of file config_flow.py.

◆ OPTIONS_FLOW

dictionary homeassistant.components.scrape.config_flow.OPTIONS_FLOW
Initial value:
1 = {
2  "init": SchemaFlowMenuStep(
3  ["resource", "add_sensor", "select_edit_sensor", "remove_sensor"]
4  ),
5  "resource": SchemaFlowFormStep(
6  DATA_SCHEMA_RESOURCE,
7  validate_user_input=validate_rest_setup,
8  ),
9  "add_sensor": SchemaFlowFormStep(
10  DATA_SCHEMA_SENSOR,
11  suggested_values=None,
12  validate_user_input=validate_sensor_setup,
13  ),
14  "select_edit_sensor": SchemaFlowFormStep(
15  get_select_sensor_schema,
16  suggested_values=None,
17  validate_user_input=validate_select_sensor,
18  next_step="edit_sensor",
19  ),
20  "edit_sensor": SchemaFlowFormStep(
21  DATA_SCHEMA_EDIT_SENSOR,
22  suggested_values=get_edit_sensor_suggested_values,
23  validate_user_input=validate_sensor_edit,
24  ),
25  "remove_sensor": SchemaFlowFormStep(
26  get_remove_sensor_schema,
27  suggested_values=None,
28  validate_user_input=validate_remove_sensor,
29  ),
30 }

Definition at line 274 of file config_flow.py.

◆ RESOURCE_SETUP

dictionary homeassistant.components.scrape.config_flow.RESOURCE_SETUP
Initial value:
1 = {
2  vol.Required(CONF_RESOURCE): TextSelector(
3  TextSelectorConfig(type=TextSelectorType.URL)
4  ),
5  vol.Optional(CONF_METHOD, default=DEFAULT_METHOD): SelectSelector(
6  SelectSelectorConfig(options=METHODS, mode=SelectSelectorMode.DROPDOWN)
7  ),
8  vol.Optional(CONF_PAYLOAD): ObjectSelector(),
9  vol.Optional(CONF_AUTHENTICATION): SelectSelector(
10  SelectSelectorConfig(
11  options=[HTTP_BASIC_AUTHENTICATION, HTTP_DIGEST_AUTHENTICATION],
12  mode=SelectSelectorMode.DROPDOWN,
13  )
14  ),
15  vol.Optional(CONF_USERNAME): TextSelector(),
16  vol.Optional(CONF_PASSWORD): TextSelector(
17  TextSelectorConfig(type=TextSelectorType.PASSWORD)
18  ),
19  vol.Optional(CONF_HEADERS): ObjectSelector(),
20  vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): BooleanSelector(),
21  vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): NumberSelector(
22  NumberSelectorConfig(min=0, step=1, mode=NumberSelectorMode.BOX)
23  ),
24  vol.Optional(CONF_ENCODING, default=DEFAULT_ENCODING): TextSelector(),
25 }

Definition at line 76 of file config_flow.py.

◆ SENSOR_SETUP

dictionary homeassistant.components.scrape.config_flow.SENSOR_SETUP

Definition at line 102 of file config_flow.py.