mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Compare commits
3 Commits
6.3.2
...
e512d0e2a0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e512d0e2a0 | ||
|
|
8161005096 | ||
|
|
ad073c10ff |
@@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changes
|
||||
- Fix PPT sliders not updating
|
||||
|
||||
## [6.3.2]
|
||||
|
||||
### Changes
|
||||
|
||||
@@ -970,52 +970,72 @@ fn print_firmware_attr(attr: &AsusArmouryProxyBlocking) -> Result<(), Box<dyn st
|
||||
let name = attr.name()?;
|
||||
println!("{}:", <&str>::from(name));
|
||||
|
||||
let attrs = attr.available_attrs()?;
|
||||
if attrs.contains(&"min_value".to_string())
|
||||
&& attrs.contains(&"max_value".to_string())
|
||||
&& attrs.contains(&"current_value".to_string())
|
||||
{
|
||||
let c = attr.current_value()?;
|
||||
let min = attr.min_value()?;
|
||||
let max = attr.max_value()?;
|
||||
println!(" current: {min}..[{c}]..{max}");
|
||||
if attrs.contains(&"default_value".to_string()) {
|
||||
println!(" default: {}\n", attr.default_value()?);
|
||||
// Be resilient to DBus read failures: if any read fails, show "unavailable"
|
||||
let attrs = attr.available_attrs().unwrap_or_default();
|
||||
|
||||
let has_min = attrs.contains(&"min_value".to_string());
|
||||
let has_max = attrs.contains(&"max_value".to_string());
|
||||
let has_current = attrs.contains(&"current_value".to_string());
|
||||
let has_possible = attrs.contains(&"possible_values".to_string());
|
||||
let has_default = attrs.contains(&"default_value".to_string());
|
||||
|
||||
if has_min && has_max && has_current {
|
||||
let c = attr.current_value().ok();
|
||||
let min = attr.min_value().ok();
|
||||
let max = attr.max_value().ok();
|
||||
match (min, c, max) {
|
||||
(Some(min), Some(c), Some(max)) => println!(" current: {min}..[{c}]..{max}"),
|
||||
_ => println!(" current: unavailable"),
|
||||
}
|
||||
|
||||
if has_default {
|
||||
match attr.default_value().ok() {
|
||||
Some(d) => println!(" default: {}\n", d),
|
||||
None => println!(" default: unavailable\n"),
|
||||
}
|
||||
} else {
|
||||
println!();
|
||||
}
|
||||
} else if attrs.contains(&"possible_values".to_string())
|
||||
&& attrs.contains(&"current_value".to_string())
|
||||
{
|
||||
let c = attr.current_value()?;
|
||||
let v = attr.possible_values()?;
|
||||
for p in v.iter().enumerate() {
|
||||
if p.0 == 0 {
|
||||
print!(" current: [");
|
||||
} else if has_possible && has_current {
|
||||
let c = attr.current_value().ok();
|
||||
let v = attr.possible_values().ok();
|
||||
if let (Some(c), Some(v)) = (c, v) {
|
||||
for p in v.iter().enumerate() {
|
||||
if p.0 == 0 {
|
||||
print!(" current: [");
|
||||
}
|
||||
if *p.1 == c {
|
||||
print!("({c})");
|
||||
} else {
|
||||
print!("{}", p.1);
|
||||
}
|
||||
if p.0 < v.len() - 1 {
|
||||
print!(",");
|
||||
}
|
||||
if p.0 == v.len() - 1 {
|
||||
print!("]");
|
||||
}
|
||||
}
|
||||
if *p.1 == c {
|
||||
print!("({c})");
|
||||
if has_default {
|
||||
match attr.default_value().ok() {
|
||||
Some(d) => println!(" default: {}\n", d),
|
||||
None => println!(" default: unavailable\n"),
|
||||
}
|
||||
} else {
|
||||
print!("{}", p.1);
|
||||
println!("\n");
|
||||
}
|
||||
if p.0 < v.len() - 1 {
|
||||
print!(",");
|
||||
}
|
||||
if p.0 == v.len() - 1 {
|
||||
print!("]");
|
||||
}
|
||||
}
|
||||
if attrs.contains(&"default_value".to_string()) {
|
||||
println!(" default: {}\n", attr.default_value()?);
|
||||
} else {
|
||||
println!("\n");
|
||||
println!(" current: unavailable\n");
|
||||
}
|
||||
} else if has_current {
|
||||
match attr.current_value().ok() {
|
||||
Some(c) => println!(" current: {c}\n"),
|
||||
None => println!(" current: unavailable\n"),
|
||||
}
|
||||
} else if attrs.contains(&"current_value".to_string()) {
|
||||
let c = attr.current_value()?;
|
||||
println!(" current: {c}\n");
|
||||
} else {
|
||||
println!();
|
||||
println!(" unavailable\n");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -654,6 +654,15 @@ impl CtrlPlatform {
|
||||
.enabled = enable;
|
||||
self.config.lock().await.write();
|
||||
|
||||
// Re-emit armoury attribute limits so GUI sees updated min/max for PPT
|
||||
// attributes which can change when enabling/disabling PPT tuning groups.
|
||||
// Fire-and-forget: we don't want to fail the property call if emit fails.
|
||||
let _ = self
|
||||
.armoury_registry
|
||||
.emit_limits(&self.connection)
|
||||
.await
|
||||
.map_err(|e| log::error!("Failed to emit armoury limits: {e:?}"));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -712,6 +721,13 @@ impl ReloadAndNotify for CtrlPlatform {
|
||||
*config = data;
|
||||
config.base_charge_control_end_threshold =
|
||||
base_charge_control_end_threshold.unwrap_or_default();
|
||||
|
||||
// Ensure any armoury limits changes from the new config are emitted
|
||||
let _ = self
|
||||
.armoury_registry
|
||||
.emit_limits(&self.connection)
|
||||
.await
|
||||
.map_err(|e| log::error!("Failed to emit armoury limits after reload: {e:?}"));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -21,21 +21,6 @@ export component PageGPU inherits Rectangle {
|
||||
padding: 12px;
|
||||
spacing: 8px;
|
||||
|
||||
Rectangle {
|
||||
background: Palette.alternate-background;
|
||||
border-color: Palette.border;
|
||||
border-width: 1px;
|
||||
border-radius: 2px;
|
||||
height: 36px;
|
||||
Text {
|
||||
font-size: 16px;
|
||||
color: Palette.control-foreground;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
text: @tr("Coming Soon: GPU Configuration");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Rectangle {
|
||||
background: Palette.alternate-background;
|
||||
border-color: Palette.border;
|
||||
@@ -74,7 +59,6 @@ export component PageGPU inherits Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user