Fix appearance

This commit is contained in:
G Johansson 2025-07-08 16:29:56 +00:00
parent 2e213c9629
commit 404801f338
3 changed files with 117 additions and 47 deletions

View File

@ -107,7 +107,8 @@ RESOURCE_SETUP = vol.Schema(
) )
), ),
} }
) ),
data_entry_flow.SectionConfig(collapsed=True),
), ),
vol.Required("advanced"): data_entry_flow.section( vol.Required("advanced"): data_entry_flow.section(
vol.Schema( vol.Schema(
@ -123,7 +124,8 @@ RESOURCE_SETUP = vol.Schema(
CONF_ENCODING, default=DEFAULT_ENCODING CONF_ENCODING, default=DEFAULT_ENCODING
): TextSelector(), ): TextSelector(),
} }
) ),
data_entry_flow.SectionConfig(collapsed=True),
), ),
} }
) )
@ -174,7 +176,8 @@ SENSOR_SETUP = vol.Schema(
) )
), ),
} }
) ),
data_entry_flow.SectionConfig(collapsed=True),
), ),
} }
) )

View File

@ -0,0 +1,21 @@
{
"config": {
"step": {
"user": {
"sections": {
"auth": "mdi:lock",
"advanced": "mdi:cog"
}
}
}
},
"options": {
"step": {
"init": {
"sections": {
"advanced": "mdi:cog"
}
}
}
}
}

View File

@ -9,25 +9,43 @@
"step": { "step": {
"user": { "user": {
"data": { "data": {
"resource": "Resource",
"authentication": "Select authentication method",
"verify_ssl": "[%key:common::config_flow::data::verify_ssl%]",
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]",
"headers": "Headers",
"method": "Method", "method": "Method",
"payload": "Payload", "payload": "Payload",
"timeout": "Timeout", "resource": "Resource"
"encoding": "Character encoding"
}, },
"data_description": { "data_description": {
"resource": "The URL to the website that contains the value.", "payload": "Payload to use when method is POST.",
"authentication": "Type of the HTTP authentication. Either basic or digest.", "resource": "The URL to the website that contains the value."
"verify_ssl": "Enables/disables verification of SSL/TLS certificate, for example if it is self-signed.", },
"sections": {
"auth": {
"name": "Authentication settings",
"description": "Provide authentication details to access the resource.",
"data": {
"authentication": "Select authentication method",
"password": "[%key:common::config_flow::data::password%]",
"username": "[%key:common::config_flow::data::username%]"
},
"data_description": {
"authentication": "Type of the HTTP authentication. Either basic or digest."
}
},
"advanced": {
"name": "Advanced settings",
"description": "Provide additional advanced settings for the resource.",
"data": {
"encoding": "Character encoding",
"headers": "Headers",
"timeout": "Timeout",
"verify_ssl": "[%key:common::config_flow::data::verify_ssl%]"
},
"data_description": {
"encoding": "Character encoding to use. Defaults to UTF-8.",
"headers": "Headers to use for the web request.", "headers": "Headers to use for the web request.",
"timeout": "Timeout for connection to website.", "timeout": "Timeout for connection to website.",
"encoding": "Character encoding to use. Defaults to UTF-8.", "verify_ssl": "Enables/disables verification of SSL/TLS certificate, for example if it is self-signed."
"payload": "Payload to use when method is POST." }
}
} }
} }
} }
@ -37,24 +55,34 @@
"step": { "step": {
"user": { "user": {
"data": { "data": {
"attribute": "Attribute",
"index": "Index", "index": "Index",
"select": "Select", "select": "Select"
"value_template": "Value template", },
"data_description": {
"index": "Defines which of the elements returned by the CSS selector to use.",
"select": "Defines what tag to search for. Check Beautifulsoup CSS selectors for details."
},
"sections": {
"advanced": {
"name": "Advanced settings",
"description": "Provide additional advanced settings for the sensor.",
"data": {
"attribute": "Attribute",
"availability": "Availability template", "availability": "Availability template",
"device_class": "Device class", "device_class": "Device class",
"state_class": "State class", "state_class": "State class",
"unit_of_measurement": "Unit of measurement" "unit_of_measurement": "Unit of measurement",
"value_template": "Value template"
}, },
"data_description": { "data_description": {
"select": "Defines what tag to search for. Check Beautifulsoup CSS selectors for details.",
"attribute": "Get value of an attribute on the selected tag.", "attribute": "Get value of an attribute on the selected tag.",
"index": "Defines which of the elements returned by the CSS selector to use.",
"value_template": "Defines a template to get the state of the sensor.",
"availability": "Defines a template to get the availability of the sensor.", "availability": "Defines a template to get the availability of the sensor.",
"device_class": "The type/class of the sensor to set the icon in the frontend.", "device_class": "The type/class of the sensor to set the icon in the frontend.",
"state_class": "The state_class of the sensor.", "state_class": "The state_class of the sensor.",
"unit_of_measurement": "Choose unit of measurement or create your own." "unit_of_measurement": "Choose unit of measurement or create your own.",
"value_template": "Defines a template to get the state of the sensor."
}
}
} }
} }
} }
@ -64,25 +92,43 @@
"step": { "step": {
"init": { "init": {
"data": { "data": {
"resource": "[%key:component::scrape::config::step::user::data::resource%]",
"method": "[%key:component::scrape::config::step::user::data::method%]", "method": "[%key:component::scrape::config::step::user::data::method%]",
"payload": "[%key:component::scrape::config::step::user::data::payload%]", "payload": "[%key:component::scrape::config::step::user::data::payload%]",
"authentication": "[%key:component::scrape::config::step::user::data::authentication%]", "resource": "[%key:component::scrape::config::step::user::data::resource%]"
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]",
"headers": "[%key:component::scrape::config::step::user::data::headers%]",
"verify_ssl": "[%key:common::config_flow::data::verify_ssl%]",
"timeout": "[%key:component::scrape::config::step::user::data::timeout%]",
"encoding": "[%key:component::scrape::config::step::user::data::encoding%]"
}, },
"data_description": { "data_description": {
"resource": "[%key:component::scrape::config::step::user::data_description::resource%]", "payload": "[%key:component::scrape::config::step::user::data_description::payload%]",
"authentication": "[%key:component::scrape::config::step::user::data_description::authentication%]", "resource": "[%key:component::scrape::config::step::user::data_description::resource%]"
"headers": "[%key:component::scrape::config::step::user::data_description::headers%]", },
"verify_ssl": "[%key:component::scrape::config::step::user::data_description::verify_ssl%]", "sections": {
"timeout": "[%key:component::scrape::config::step::user::data_description::timeout%]", "auth": {
"encoding": "[%key:component::scrape::config::step::user::data_description::encoding%]", "name": "[%key:component::scrape::config::step::user::sections::auth::name%]",
"payload": "[%key:component::scrape::config::step::user::data_description::payload%]" "description": "[%key:component::scrape::config::step::user::sections::auth::description%]",
"data": {
"authentication": "[%key:component::scrape::config::step::user::sections::auth::data::authentication%]",
"password": "[%key:common::config_flow::data::password%]",
"username": "[%key:common::config_flow::data::username%]"
},
"data_description": {
"authentication": "[%key:component::scrape::config::step::user::sections::auth::data_description::authentication%]"
}
},
"advanced": {
"name": "[%key:component::scrape::config::step::user::sections::advanced::name%]",
"description": "[%key:component::scrape::config::step::user::sections::advanced::description%]",
"data": {
"encoding": "[%key:component::scrape::config::step::user::sections::advanced::data::encoding%]",
"headers": "[%key:component::scrape::config::step::user::sections::advanced::data::headers%]",
"timeout": "[%key:component::scrape::config::step::user::sections::advanced::data::timeout%]",
"verify_ssl": "[%key:common::config_flow::data::verify_ssl%]"
},
"data_description": {
"encoding": "[%key:component::scrape::config::step::user::sections::advanced::data_description::encoding%]",
"headers": "[%key:component::scrape::config::step::user::sections::advanced::data_description::headers%]",
"timeout": "[%key:component::scrape::config::step::user::sections::advanced::data_description::timeout%]",
"verify_ssl": "[%key:component::scrape::config::step::user::sections::advanced::data_description::verify_ssl%]"
}
}
} }
} }
} }