Dashboard: fix display of flat phys fields (procedural domain)
The outer loop in DashboardTab.update assumed a 3-level hierarchy (domain → object → fields). Procedural fields sit one level higher (domain → field directly). Check _is_phys() first and render value / unit into the correct columns instead of descending into the dict and showing 'value' and 'unit' as separate rows. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -107,6 +107,7 @@ _TRACE_LABELS: dict[str, str] = {
|
||||
"measurements.temperatureBatteryStatus.temperatureHvBatteryMax": "batt. temp max",
|
||||
"measurements.temperatureBatteryStatus.temperatureHvBatteryMin": "batt. temp min",
|
||||
"measurements.temperatureOutsideStatus.temperatureOutside": "outside temp",
|
||||
"procedural.range_at_100": "range 100%"
|
||||
}
|
||||
|
||||
|
||||
@@ -333,8 +334,11 @@ class DashboardTab(QWidget):
|
||||
d_item.setFont(0, bold)
|
||||
d_item.setForeground(0, domain_color)
|
||||
for obj_name, fields in domain_data.items():
|
||||
if not isinstance(fields, dict):
|
||||
continue
|
||||
if _is_phys(fields):
|
||||
item = QTreeWidgetItem([obj_name, str(fields["value"]), fields["unit"]])
|
||||
item.setTextAlignment(1, Qt.AlignRight | Qt.AlignVCenter)
|
||||
d_item.addChild(item)
|
||||
elif isinstance(fields, dict):
|
||||
obj_item = QTreeWidgetItem([obj_name])
|
||||
obj_item.setFont(0, bold)
|
||||
self._add_fields(obj_item, fields, f"{domain}/{obj_name}")
|
||||
|
||||
Reference in New Issue
Block a user