Fix loading battery settings from json, update some deps

This commit is contained in:
NGnius (Graham) 2023-04-02 13:36:33 -04:00
parent 2f8c0a0172
commit 533beaf289
3 changed files with 15 additions and 15 deletions

20
backend/Cargo.lock generated
View file

@ -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]]

View file

@ -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

View file

@ -93,18 +93,18 @@ impl EventInstruction {
#[inline]
fn str_to_trigger(s: &str) -> Option<EventTrigger> {
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::<f64>()
.ok()
.map(|x| EventTrigger::BatteryAbove(x)),
.map(|x| EventTrigger::BatteryAbove(x/100.0)),
s if s.starts_with('<') => s
.trim_start_matches('<')
.parse::<f64>()
.ok()
.map(|x| EventTrigger::BatteryBelow(x)),
.map(|x| EventTrigger::BatteryBelow(x/100.0)),
_ => None,
}
}