From 533beaf289505ef9467ac58d4d150218374b6a87 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 2 Apr 2023 13:36:33 -0400 Subject: [PATCH] Fix loading battery settings from json, update some deps --- backend/Cargo.lock | 20 ++++++++++---------- backend/build-docker.sh | 2 +- backend/src/settings/steam_deck/battery.rs | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index f8baccd..0f3aad4 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -85,7 +85,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.12", + "syn 2.0.13", ] [[package]] @@ -96,7 +96,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.12", + "syn 2.0.13", ] [[package]] @@ -330,7 +330,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.12", + "syn 2.0.13", ] [[package]] @@ -347,7 +347,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.12", + "syn 2.0.13", ] [[package]] @@ -1086,9 +1086,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.54" +version = "1.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" +checksum = "1d0dd4be24fcdcfeaa12a432d588dc59bbad6cad3510c67e74a2b6b2fc950564" dependencies = [ "unicode-ident", ] @@ -1199,7 +1199,7 @@ checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" dependencies = [ "proc-macro2", "quote", - "syn 2.0.12", + "syn 2.0.13", ] [[package]] @@ -1291,9 +1291,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.12" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79d9531f94112cfc3e4c8f5f02cb2b58f72c97b7efd85f70203cc6d8efda5927" +checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" dependencies = [ "proc-macro2", "quote", @@ -1326,7 +1326,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.12", + "syn 2.0.13", ] [[package]] diff --git a/backend/build-docker.sh b/backend/build-docker.sh index a8f84b1..9736989 100755 --- a/backend/build-docker.sh +++ b/backend/build-docker.sh @@ -10,7 +10,7 @@ mkdir -p out echo "--- Building ryzenadj lib ---" git clone https://github.com/FlyGoat/RyzenAdj ryzenadj cd ryzenadj -git checkout -q 187549bd0a92f84508161aabfd958b09540c7e56 +git checkout -q 160502771054d31d2f4c2fa46ad42c96336f3a74 mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=Release .. make diff --git a/backend/src/settings/steam_deck/battery.rs b/backend/src/settings/steam_deck/battery.rs index 2c939ac..4a5305c 100644 --- a/backend/src/settings/steam_deck/battery.rs +++ b/backend/src/settings/steam_deck/battery.rs @@ -93,18 +93,18 @@ impl EventInstruction { #[inline] fn str_to_trigger(s: &str) -> Option { match s { - "normal" => Some(EventTrigger::PluggedIn), - "idle" => Some(EventTrigger::PluggedOut), + "plug-in" => Some(EventTrigger::PluggedIn), + "plug-out" => Some(EventTrigger::PluggedOut), s if s.starts_with('>') => s .trim_start_matches('>') .parse::() .ok() - .map(|x| EventTrigger::BatteryAbove(x)), + .map(|x| EventTrigger::BatteryAbove(x/100.0)), s if s.starts_with('<') => s .trim_start_matches('<') .parse::() .ok() - .map(|x| EventTrigger::BatteryBelow(x)), + .map(|x| EventTrigger::BatteryBelow(x/100.0)), _ => None, } }