Refactor tab creation for control interface

Fix https://github.com/flobz/psa_car_controller/issues/1232
Thanks to @Dirtylife.

Tested and works for me.
This commit is contained in:
Arnoudd
2026-08-12 20:45:56 +02:00
committed by Florian BEZANNIER
parent 04244ac8ea
commit 1c118170f8
+14 -2
View File
@@ -76,5 +76,17 @@ def get_control_tabs(config):
if not config.offline:
buttons_row.append(Switch(ABRP_SWITCH, car.vin, "Send data to ABRP", myp.abrp.enable_abrp,
car.vin in config.myp.abrp.abrp_enable_vin).get_html())
tabs.append(dbc.Tab(label=label, id="tab-" + car.vin, children=[dbc.Row(buttons_row), *el]))
return dbc.Tabs(id="control-tabs", children=tabs)
tabs.append(
dbc.Tab(
label=label,
id="tab-" + car.vin,
tab_id="tab-" + car.vin,
children=[dbc.Row(buttons_row), *el],
)
)
return dbc.Tabs(
id="control-tabs",
active_tab="tab-" + config.myp.vehicles_list[0].vin,
children=tabs,
)