Move smc capability logging out of global scope so it does not interfere with status_csv command

This commit is contained in:
user
2025-10-04 02:57:53 +02:00
parent 556565c145
commit 30768087bc

View File

@@ -184,7 +184,10 @@ function smc_write_hex() {
[[ $(smc -k CHIE -r) =~ "no data" ]] && smc_supports_adapter_chie=false || smc_supports_adapter_chie=true;
[[ $(smc -k CH0I -r) =~ "no data" ]] && smc_supports_adapter_ch0i=false || smc_supports_adapter_ch0i=true;
[[ $(smc -k CH0J -r) =~ "no data" || $(smc -k CH0J -r) =~ "Error" ]] && smc_supports_adapter_ch0j=false || smc_supports_adapter_ch0j=true;
log "SMC capabilities: tahoe=$smc_supports_tahoe legacy=$smc_supports_legacy CHIE=$smc_supports_adapter_chie CH0I=$smc_supports_adapter_ch0i CH0J=$smc_supports_adapter_ch0j"
function log_smc_capabilities() {
log "SMC capabilities: tahoe=$smc_supports_tahoe legacy=$smc_supports_legacy CHIE=$smc_supports_adapter_chie CH0I=$smc_supports_adapter_ch0i CH0J=$smc_supports_adapter_ch0j"
}
## #################
## SMC Manipulation
@@ -609,6 +612,8 @@ fi
# Maintain at level
if [[ "$action" == "maintain_synchronous" ]]; then
log_smc_capabilities
# Checking if the calibration process is running
if test -f "$calibrate_pidfile"; then
pid=$(cat "$calibrate_pidfile" 2>/dev/null)
@@ -688,6 +693,8 @@ fi
# Maintain at voltage
if [[ "$action" == "maintain_voltage_synchronous" ]]; then
log_smc_capabilities
# Recover old maintain status if old setting is found
if [[ "$setting" == "recover" ]]; then