refactor: separate unit in temperature sensors

Do not append the `°C` unit to temperature sensors.
Add the unit in a separate label key with `#unit` suffix.

This allows filtering out the unit label if the panel has a graphical
representation of the unit.
This commit is contained in:
Markus Zehnder
2025-09-16 21:12:31 +02:00
parent 972f7e18df
commit 1e2616848a
+2 -2
View File
@@ -401,8 +401,8 @@ impl SysinfoSource {
// component.label(), component.type_id(), component.id());
}
// TODO add unit as a separate sensor?
add_sensor(sensors, label, format!("{temperature:.1} °C"));
add_sensor(sensors, format!("{label}#unit"), "°C");
add_sensor(sensors, label, format!("{temperature:.1}"));
}
}