Hi,
I tried to collapse some input fields to get an better overview.
So far the collapsing itself is working but it doesn’t store/update any of the variables in the section.
current_data = self.config_entry.data
transport_types = DEFAULT_CONF_TRANSPORTTYPES.split(',')
selected_transport_types = current_data.get(CONF_TRANSPORTTYPES, '').split(',')
self.options_schema = vol.Schema({
vol.Required(CONF_NAME, default=current_data.get(CONF_NAME)): str,
vol.Required(CONF_GLOBALID, default=current_data.get(CONF_GLOBALID)): str,
vol.Optional(CONF_TRANSPORTTYPES, default=selected_transport_types): selector({
"select": {
"options": transport_types,
"multiple": True,
"custom_value": True
}
}),
vol.Optional(CONF_LIMIT, default=current_data.get(CONF_LIMIT, DEFAULT_LIMIT)): int,
vol.Optional(CONF_ONLYLINE, description={"suggested_value": current_data.get(CONF_ONLYLINE, "")}): str,
vol.Optional(CONF_HIDEDESTINATION, description={"suggested_value": current_data.get(CONF_HIDEDESTINATION, "")}): str,
vol.Optional(CONF_ONLYDESTINATION, description={"suggested_value": current_data.get(CONF_ONLYDESTINATION, "")}): str,
# Items can be grouped by collapsible sections
"advanced_options": section(
vol.Schema(
{
vol.Optional(CONF_HIDENAME, description={"suggested_value": current_data.get(CONF_HIDENAME, "")}): bool,
vol.Optional(CONF_GLOBALID2, description={"suggested_value": current_data.get(CONF_GLOBALID2, "")}): str,
vol.Optional(CONF_DOUBLESTATIONNUMBER, description={"suggested_value": current_data.get(CONF_DOUBLESTATIONNUMBER, "")}): str,
vol.Optional(CONF_TIMEZONE_FROM, description={"suggested_value": current_data.get(CONF_TIMEZONE_FROM, "")}): str,
vol.Optional(CONF_TIMEZONE_TO, description={"suggested_value": current_data.get(CONF_TIMEZONE_TO, "")}): str,
vol.Optional(CONF_ALERT_FOR, description={"suggested_value": current_data.get(CONF_ALERT_FOR, "")}): str,
}
),
# Whether or not the section is initially collapsed (default = False)
{"collapsed": True},
)
})
return self.async_show_form(
step_id="init",
data_schema=self.options_schema
)
I assume its only an optical section. Or does HA stores the variables in an advanced_options
array or something like that ?
I only want to (optical) collapse some of the fields.
dosnt contain the needed information