From 1ebf97116d83d362ed16c56fc9249ee7a430d166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Xaver=20H=C3=B6rl?= Date: Thu, 8 Jun 2023 17:00:26 +0200 Subject: [PATCH] refresh fan_speed after suspend This is needed on systems where the hardware changes the value on its own after suspend and the cached value becomes stale. --- tailord/src/fancontrol/runtime.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tailord/src/fancontrol/runtime.rs b/tailord/src/fancontrol/runtime.rs index 5b3b30f..3b4253d 100644 --- a/tailord/src/fancontrol/runtime.rs +++ b/tailord/src/fancontrol/runtime.rs @@ -36,7 +36,9 @@ impl FanRuntimeData { tokio::select! { _ = tokio::time::sleep(delay) => {}, - _ = process_suspend(&mut self.suspend_receiver) => {} + _ = process_suspend(&mut self.suspend_receiver) => { + self.fan_speed = self.io.get_fan_speed_percent(0).unwrap(); + } } } }