File tree 1 file changed +7
-3
lines changed
src/app/data_harvester/temperature
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -114,16 +114,20 @@ fn get_from_hwmon(
114
114
let drm = device. join ( "drm" ) ;
115
115
if drm. exists ( ) {
116
116
// This should never actually be empty
117
- let mut gpu = String :: new ( ) ;
117
+ let mut gpu = None ;
118
118
for card in drm. read_dir ( ) ? {
119
119
let card = card?;
120
120
let name = card. file_name ( ) . to_str ( ) . unwrap_or_default ( ) . to_owned ( ) ;
121
121
if name. starts_with ( "card" ) {
122
- gpu = name;
122
+ if let Some ( hwmon_name) = hwmon_name. as_ref ( ) {
123
+ gpu = Some ( format ! ( "{} ({})" , name, hwmon_name. trim( ) ) ) ;
124
+ } else {
125
+ gpu = Some ( name)
126
+ }
123
127
break ;
124
128
}
125
129
}
126
- Some ( gpu)
130
+ gpu
127
131
} else {
128
132
// This little mess is to account for stuff like k10temp
129
133
// This is needed because the `device` symlink
You can’t perform that action at this time.
0 commit comments