Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: get status and capacity with multiple power_supplies #297

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

NeumoNeumo
Copy link
Contributor

It is possible that $BAT contains multiple power_supplies like

/sys/class/power_supply/AC
/sys/class/power_supply/BAT0
/sys/class/power_supply/ucsi-source-psy-USBC000:001

In such a case, the original code becomes
cat AC BAT0 ucsi-source-psy-USBC000:001/status (path prefix omitted). It fails to run because you cannot cat a directory.

It is possible that $BAT contains multiple power_supplies like
```bash
/sys/class/power_supply/AC
/sys/class/power_supply/BAT0
/sys/class/power_supply/ucsi-source-psy-USBC000:001
```
In such a case, the original code becomes
`cat AC BAT0 ucsi-source-psy-USBC000:001/status` (path prefix omitted). It fails
to run because you cannot `cat` a directory.
@ethancedwards8
Copy link
Member

Perfect. Thank you!

@ethancedwards8 ethancedwards8 merged commit 5b0f4b5 into dracula:master Oct 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants