implemented multiple fans

This commit is contained in:
2026-02-26 14:06:49 +01:00
parent 7e2bef58d2
commit cab39a6478
10 changed files with 101 additions and 44 deletions

View File

@@ -54,10 +54,11 @@ pub trait EnvironmentGuard {
}
/// Read-only interface for standardized metrics.
pub trait SensorBus {
pub trait SensorBus: Send + Sync {
fn get_temp(&self) -> Result<f32>;
fn get_power_w(&self) -> Result<f32>;
fn get_fan_rpm(&self) -> Result<u32>;
fn get_fan_rpms(&self) -> Result<Vec<u32>>;
fn get_freq_mhz(&self) -> Result<f32>;
}
impl<T: SensorBus + ?Sized> SensorBus for Arc<T> {
@@ -67,8 +68,11 @@ impl<T: SensorBus + ?Sized> SensorBus for Arc<T> {
fn get_power_w(&self) -> Result<f32> {
(**self).get_power_w()
}
fn get_fan_rpm(&self) -> Result<u32> {
(**self).get_fan_rpm()
fn get_fan_rpms(&self) -> Result<Vec<u32>> {
(**self).get_fan_rpms()
}
fn get_freq_mhz(&self) -> Result<f32> {
(**self).get_freq_mhz()
}
}