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

Spurious battery level notification #2247

Closed
2 tasks done
NeilGirdhar opened this issue May 10, 2024 · 5 comments · May be fixed by #2248
Closed
2 tasks done

Spurious battery level notification #2247

NeilGirdhar opened this issue May 10, 2024 · 5 comments · May be fixed by #2248
Labels

Comments

@NeilGirdhar
Copy link

Ubuntu 24.04
openrazer-daemon: 3.7.0+dfsg-1

Support

Getting battery notifications despite:
Battery level is 41%
razer.conf shows:

# Battery notification frequency [s] (0 to disable)
battery_notifier_freq = 600

# Battery notifications appear when device reaches this percentage
battery_notifier_percent = 33
@z3ntu
Copy link
Member

z3ntu commented May 10, 2024

The percentage from the config is read at

self._battery_manager.percent = self.config.getint('Startup', 'battery_notifier_percent', fallback=33)
and then used in
if battery_level <= self.percent:
, so not quite sure where it could be going wrong.

Also are you sure the message is what you wrote and not "Battery is 41%"? That would be the message from the daemon.

@NeilGirdhar
Copy link
Author

NeilGirdhar commented May 10, 2024

@z3ntu Thanks for taking a look. The thing is that the alert that I get says I have 0%, but the battery level showing in the controller says 94%.

Is there a way for me to install the openrazor Python library so that I can check whether the code you quoted is working correctly? Trying to use it in the normal way:

File ~/.pyenv/versions/3.12.3/lib/python3.12/site-packages/openrazer/__init__.py:1
----> 1 raise RuntimeError("Should never be installed")

Why is battery level 0% treated differently than 1%? Do you get faulty zeros and you're trying to ignore them? Because that would explain this issue.

@z3ntu
Copy link
Member

z3ntu commented May 10, 2024

The thing is that the alert that I get says I have 0%

Ah, the 0% issue, I thought you said you get a popup that the battery is at 41% even though the config says only notifications below 33%.

See #2203 (comment) and #2122 then.

@z3ntu z3ntu closed this as completed May 10, 2024
@z3ntu
Copy link
Member

z3ntu commented May 10, 2024

Also the "openrazer" package on PyPI is just a dummy package, you shouldn't install it from there - that's what that RuntimeError is saying.

@NeilGirdhar
Copy link
Author

NeilGirdhar commented May 10, 2024

Ah, the 0% issue, I thought you said you get a popup that the battery is at 41% even though the config says only notifications below 33%.

Sorry, I should have been clearer. Can we just ignore 0% battery level if it's sporadic? I added a PR that does this. What do you think?

Also, I don't understand why the app seems to know my battery level when the popup doesn't? Is it ignoring zeros? Polling in a different way?

Also the "openrazer" package on PyPI is just a dummy package, you shouldn't install it from there - that's what that RuntimeError is saying.

Right. Should I just install it from github then?

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

Successfully merging a pull request may close this issue.

2 participants