Use incompatible hwmon for battery in the unlikely event the hwmon still has the correct name. version to alpha2

This commit is contained in:
NGnius (Graham) 2023-08-07 15:57:08 -04:00
parent 64cb4193f9
commit b7cf8b8caf
8 changed files with 6 additions and 8 deletions

2
backend/Cargo.lock generated
View file

@ -1043,7 +1043,7 @@ dependencies = [
[[package]] [[package]]
name = "powertools" name = "powertools"
version = "1.4.0-alpha" version = "1.4.0-alpha2"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"libryzenadj", "libryzenadj",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "powertools" name = "powertools"
version = "1.4.0-alpha" version = "1.4.0-alpha2"
edition = "2021" edition = "2021"
authors = ["NGnius (Graham) <ngniusness@gmail.com>"] authors = ["NGnius (Graham) <ngniusness@gmail.com>"]
description = "Backend (superuser) functionality for PowerTools" description = "Backend (superuser) functionality for PowerTools"

View file

@ -279,12 +279,10 @@ impl Battery {
let root = crate::settings::util::root_or_default_sysfs(root); let root = crate::settings::util::root_or_default_sysfs(root);
match root.hwmon_by_name(super::util::JUPITER_HWMON_NAME) { match root.hwmon_by_name(super::util::JUPITER_HWMON_NAME) {
Ok(hwmon) => { Ok(hwmon) => {
if hwmon.capable(attributes(HWMON_NEEDS.into_iter().copied())) { if !hwmon.capable(attributes(HWMON_NEEDS.into_iter().copied())) {
hwmon log::warn!("Found incapable SteamDeck battery hwmon in sysfs (hwmon by name {} exists but missing attributes), persevering because ignorance is bliss", super::util::JUPITER_HWMON_NAME);
} else {
log::error!("Failed to find SteamDeck battery hwmon in sysfs (hwmon by name {} exists but missing attributes), using naive fallback", super::util::JUPITER_HWMON_NAME);
root.hwmon_by_index(5)
} }
hwmon
}, },
Err(e) => { Err(e) => {
log::error!("Failed to find SteamDeck battery hwmon in sysfs ({}), using naive fallback", e); log::error!("Failed to find SteamDeck battery hwmon in sysfs ({}), using naive fallback", e);

View file

@ -1,6 +1,6 @@
{ {
"name": "PowerTools", "name": "PowerTools",
"version": "1.4.0-alpha", "version": "1.4.0-alpha2",
"description": "Power tweaks for power users", "description": "Power tweaks for power users",
"scripts": { "scripts": {
"build": "shx rm -rf dist && rollup -c", "build": "shx rm -rf dist && rollup -c",

Binary file not shown.

Binary file not shown.

BIN
translations/ru-RU.mo Normal file

Binary file not shown.

BIN
translations/uk-UA.mo Normal file

Binary file not shown.