Skip to content

Commit

Permalink
feat: support Raspberry Pi
Browse files Browse the repository at this point in the history
  • Loading branch information
rise0chen committed Aug 23, 2024
1 parent 176db28 commit 9acef9f
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 9acef9f

Please sign in to comment.