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

[Ideapad] --stats gives error as BAT0 can't be found #700

Closed
LnLcFlx opened this issue May 14, 2024 · 4 comments
Closed

[Ideapad] --stats gives error as BAT0 can't be found #700

LnLcFlx opened this issue May 14, 2024 · 4 comments

Comments

@LnLcFlx
Copy link

LnLcFlx commented May 14, 2024

Error output of auto-cpufreq --stats:


Using settings defined in /etc/auto-cpufreq.conf file

Note: You can quit stats mode by pressing "ctrl+c"
could not get value from conservation mode

-------------------------------- Battery Info ---------------------------------

battery count = 1
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/auto_cpufreq/battery_scripts/ideapad_laptop.py", line 92, in ideapad_laptop_print_thresholds
    with open(f'/sys/class/power_supply/BAT{b}/charge_start_threshold', 'r') as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/sys/class/power_supply/BAT0/charge_start_threshold'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/sbin/auto-cpufreq", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/auto_cpufreq/bin/auto_cpufreq.py", line 157, in main
    battery_get_thresholds()
  File "/usr/lib/python3.12/site-packages/auto_cpufreq/battery_scripts/battery.py", line 42, in battery_get_thresholds
    ideapad_laptop_print_thresholds()
  File "/usr/lib/python3.12/site-packages/auto_cpufreq/battery_scripts/ideapad_laptop.py", line 101, in ideapad_laptop_print_thresholds
    print(f"ERROR: failed to read battery thresholds: {e}")
                                                       ^
NameError: name 'e' is not defined

System information:

I'm running Arch on an IdeaPad 5 Pro 14ACN6.
My battery is indeed on BAT1 and not BAT0 but I don't know of an option to specify this.

@AdnanHodzic
Copy link
Owner

@PurpleWazard ^

@LnLcFlx if you want us to help you with this problem, please fill out the issue template.

Reference:

Fill out informtion requested in this template, without doing so issue will be ignored & closed!

Have you tried?

Error output:

Add/paste error output in case of failed installation or other failing component

System information:

Add/paste output of:

auto-cpufreq --debug

@LnLcFlx
Copy link
Author

LnLcFlx commented May 14, 2024

I know and I have tried all the above and running --debug gives the same error ironically... thats why I left it out

@shadeyg56
Copy link
Collaborator

I'm at work, but I can try to push out a patch for this later, if Purple can't get to it

@shadeyg56
Copy link
Collaborator

1f911b5

Should be fixed, but since I don't have any supported laptops, I couldn't test for myself.
Give it a try please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants