pub fn compute_device_label(
target: &HardwareDevice,
all_devices: &[HardwareDevice],
nicknames: &HashMap<String, String>,
) -> StringExpand description
Compute the display label for a single device given the full device list + nickname map. The rule:
- If a nickname is set for this key, the label IS the nickname.
- Otherwise, if another un-nicknamed device shares this model string, append a location-derived suffix (“(payload after the key’s scheme prefix)”) so the user can tell them apart.
- Otherwise, the bare
modelstring.
Both the daemon (SensorInfo.device_label decoration) and the GUI
(HardwareModel’s page-title rendering) call this so they can
never disagree on what a device is named.