mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-07 15:10:29 -04:00
hardware: Let fan control be configured and disabled
This commit is contained in:
parent
92235d0f47
commit
7dc0d0969d
4 changed files with 94 additions and 16 deletions
|
@ -582,7 +582,12 @@ pub(crate) async fn create_interfaces(
|
|||
object_server.at(MANAGER_PATH, factory_reset).await?;
|
||||
}
|
||||
|
||||
object_server.at(MANAGER_PATH, fan_control).await?;
|
||||
if config
|
||||
.as_ref()
|
||||
.is_some_and(|config| config.fan_control.is_some())
|
||||
{
|
||||
object_server.at(MANAGER_PATH, fan_control).await?;
|
||||
}
|
||||
|
||||
if !get_available_gpu_performance_levels()
|
||||
.await
|
||||
|
@ -645,7 +650,7 @@ mod test {
|
|||
use crate::daemon::user::UserContext;
|
||||
use crate::hardware::test::fake_model;
|
||||
use crate::hardware::HardwareVariant;
|
||||
use crate::platform::{PlatformConfig, ScriptConfig, StorageConfig};
|
||||
use crate::platform::{PlatformConfig, ScriptConfig, ServiceConfig, StorageConfig};
|
||||
use crate::{power, testing};
|
||||
|
||||
use std::time::Duration;
|
||||
|
@ -664,6 +669,9 @@ mod test {
|
|||
update_bios: Some(ScriptConfig::default()),
|
||||
update_dock: Some(ScriptConfig::default()),
|
||||
storage: Some(StorageConfig::default()),
|
||||
fan_control: Some(ServiceConfig::Systemd(String::from(
|
||||
"jupiter-fan-control.service",
|
||||
))),
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -767,6 +775,13 @@ mod test {
|
|||
.unwrap());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn interface_missing_fan_control1() {
|
||||
let test = start(None).await.expect("start");
|
||||
|
||||
assert!(test_interface_missing::<FanControl1>(&test.connection).await);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn interface_matches_gpu_performance_level1() {
|
||||
let test = start(all_config()).await.expect("start");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue