# Reading hardware components
```rust,no_run
# fn main() -> Result<(), Box<dyn std::error::Error>> {
use sinf::component::Components;
let components = Components::new_with_refreshed_list()?;
for component in &components {
println!(
"{:?}: {:?}°C (max {:?}°C)",
component.label(),
component.temperature(),
component.max(),
);
}
# Ok(())
# }
```
Not every platform exposes every sensor; unavailable values are `None`.
## Identifiers
`Component::id()` is reasonably unique, but it comes from the kernel and may
change when the hardware changes or after a reboot:
| Linux/hwmon | hwmon file concatenated with the temperature index | `hwmon0_1` |
| Linux/thermal | thermal file name | `thermal_zone0` |
| FreeBSD | `cpu_` + core index | `cpu_1` |
| macOS/arm | serial ID reported by the HID driver | |
| macOS/x86 | technical ID sent to the OS | `TXCX` |
| Windows | `Computer` (same as the label) | `Computer` |
| App Store / unknown | not available | `None` |
macOS x86 identifiers: `TXCX`/`TXCx` (PECI CPU, iMac/MacBook), `TC0P` (CPU
proximity), `TG0P` (GPU), `TB0T` (battery).
## Labels
On Linux, labels are built from the available `hwmon` values (format inspired
by `sensors`; it may change):
| yes | yes | yes | yes | `"{name} {label} {device_model}"` |
| yes | yes | no | yes | `"{name} {label}"` |
| yes | no | yes | yes | `"{name} {device_model}"` |
| yes | no | no | yes | `"{name} temp{id}"` |