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:
@@ -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}"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user