Skip to content

Commit

Permalink
Merge pull request #1342 from rise0chen/master
Browse files Browse the repository at this point in the history
feat: support Raspberry Pi
  • Loading branch information
GuillaumeGomez committed Aug 23, 2024
2 parents 176db28 + 9acef9f commit 3dff49e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/unix/linux/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,16 @@ impl ComponentsInner {
}
}
}
if self.components.is_empty() {
// Specfic to raspberry pi.
let thermal_path = Path::new("/sys/class/thermal/thermal_zone0/");
if thermal_path.join("temp").exists() {
let mut component = ComponentInner::default();
fill_component(&mut component, "input", thermal_path, "temp");
let name = get_file_line(&thermal_path.join("type"), 16);
component.name = name.unwrap_or_default();
self.components.push(Component { inner: component });
}
}
}
}

0 comments on commit 3dff49e

Please sign in to comment.