From 1c118170f83135eff1e9d78b37bd8a666564422e Mon Sep 17 00:00:00 2001 From: Arnoudd <126021001+Arnoudd@users.noreply.github.com> Date: Mon, 10 Aug 2026 22:48:13 +0200 Subject: [PATCH] Refactor tab creation for control interface Fix https://github.com/flobz/psa_car_controller/issues/1232 Thanks to @Dirtylife. Tested and works for me. --- psa_car_controller/web/view/control.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/psa_car_controller/web/view/control.py b/psa_car_controller/web/view/control.py index bf1661c..2e10ed2 100644 --- a/psa_car_controller/web/view/control.py +++ b/psa_car_controller/web/view/control.py @@ -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, + )