Code Monkey home page Code Monkey logo

Comments (7)

monarc99 avatar monarc99 commented on August 26, 2024 1

it does not stop at the error, but another one :)

i try your tool on a normal desktop without battery. But i have a wireless mouse and keyboard.
i would be interested in switching power configurations on desktop depending on temperature (later), specified running processes and the current workload (later)

i get the error:


Traceback (most recent call last):
File "/usr/bin/powerplan", line 10, in
import status
File "/opt/powerplan/src/status.py", line 9, in
import powersupply
File "/opt/powerplan/src/powersupply.py", line 123, in
CURRENT_NOW = BAT.with_name('current_now')
AttributeError: 'NoneType' object has no attribute 'with_name'


with your new powersupply branch i get:


Traceback (most recent call last):
File "/usr/bin/powerplan", line 10, in
import status
File "/opt/powerplan/src/status.py", line 9, in
import powersupply
File "/opt/powerplan/src/powersupply.py", line 313, in
AC, BAT = power_supply_detection()
File "/opt/powerplan/src/powersupply.py", line 266, in power_supply_detection
return ACAdapter(ac_path), Battery(bat_path)
File "/opt/powerplan/src/powersupply.py", line 42, in init
self.name = path.name
AttributeError: 'NoneType' object has no attribute 'name'


in /sys/class/power_supply/
are my wireless mouse/keyboard


hidpp_battery_0
hidpp_battery_1


content of hidpp_battery_0


==> /sys/class/power_supply/hidpp_battery_0/capacity_level <==
Full
==> /sys/class/power_supply/hidpp_battery_0/manufacturer <==
Logitech
==> /sys/class/power_supply/hidpp_battery_0/model_name <==
MX Keys Wireless Keyboard
==> /sys/class/power_supply/hidpp_battery_0/online <==
1
==> /sys/class/power_supply/hidpp_battery_0/scope <==
Device
==> /sys/class/power_supply/hidpp_battery_0/status <==
Discharging
==> /sys/class/power_supply/hidpp_battery_0/type <==
Battery
==> /sys/class/power_supply/hidpp_battery_0/uevent <==
POWER_SUPPLY_NAME=hidpp_battery_0
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_STATUS=Discharging
POWER_SUPPLY_SCOPE=Device
POWER_SUPPLY_MODEL_NAME=MX Keys Wireless Keyboard
POWER_SUPPLY_MANUFACTURER=Logitech
POWER_SUPPLY_CAPACITY_LEVEL=Full


maybe /sys/class/power_supply/hidpp_battery_0/scope = Device ?

from powerplan.

monarc99 avatar monarc99 commented on August 26, 2024 1

This works well. :)

It switches profiles, if i use triggerapps.

from powerplan.

Haptein avatar Haptein commented on August 26, 2024

Thanks for reporting! It should be fixed now.

from powerplan.

Haptein avatar Haptein commented on August 26, 2024

Thanks for your detailed response! Your devices' batteries are filtered out by name, the issue lies in an oversight when creating some needed paths without a battery present. This problem won't exist with the changes in the powersupply branch but it is still work in progress and not ready for testing. In the meantime, I added a fix for this in the main branch.

from powerplan.

Haptein avatar Haptein commented on August 26, 2024

I thought it'd take longer, the powersupply branch should be ready for merging. I'd be grateful If you could test it 🤖

from powerplan.

monarc99 avatar monarc99 commented on August 26, 2024

i get:


Traceback (most recent call last):
File "/usr/bin/powerplan", line 10, in
import status
File "/opt/powerplan/src/status.py", line 24, in
Policies:\t\t{', '.join(CPU.policies)}
AttributeError: 'CPUSpec' object has no attribute 'policies'


from powerplan.

Haptein avatar Haptein commented on August 26, 2024

Thank you for being patient. You're not only the first person reporting issues on a desktop pc but also the first using a cpufreq driver. My only setup is literally the opposite, so you reporting this chain of problems is of great help! 🤗
The needed changes are implemented in the main branch now 👍

from powerplan.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.