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

Battery level support #735

Open
wants to merge 104 commits into
base: master
Choose a base branch
from
Open

Battery level support #735

wants to merge 104 commits into from

Conversation

JCKodel
Copy link

@JCKodel JCKodel commented Dec 7, 2022

This pull request will add 2 things:

  1. Update the battery level on the tray itself, so it is visible without having to click on the menu (it will show all battery enabled devices, but I just have one to test, so, don't know how this would be when multiple devices shows their levels):

image

  1. A new color option called Battery Level that will set the device lights from green to red, depending on the battery level

overcurrent and others added 30 commits September 12, 2021 22:45
I think I doing these pull request correctly, but if not, I added the dmg as a release on my fork.
Support for the New DeathAdder Essential
* Huntsman V2 Support

* Update librazermacos

* Update Readme

Confirmed working in [1kc#482](1kc#482)
Add Huntsman Mini to the confirmed working list
Bumps [electron](https://github.com/electron/electron) from 11.2.2 to 11.5.0.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](electron/electron@v11.2.2...v11.5.0)

---
updated-dependencies:
- dependency-name: electron
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Implement Thunderbolt 4 Dock Chroma support
1kc and others added 27 commits March 14, 2022 00:54
feat: add UI support for Razer Basilisk V3
Fixes:
- Error in razermouse_driver.c
- Missing additions to .gitignore from 1kc#463
- Added missing matrix brightness support
- Removed `battery` from `featuresMissing` as it is unnecessary
electron-builder:
- Updated to the latest release
- No longer a pre-release
- Now uses the same electron universal version as this PR (v1.2.1)

source-map-support
- Updated to dedupe
…operty

Add missing max DPI property to Mamba TE
Fix Basilisk V3 and Huntsman V2 Analog
Update broken support link and match text to link content
Copy link
Collaborator

@dhobi dhobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BatteryAnimation proposal in comments...
(The PR looks really messy because of the force push to remove the sensitive data. I recommend to create a new one and change the password...JUST in case... 👍 )

@@ -305,6 +309,28 @@ export class Application {
this.refreshTray(true);
}

updateTrayBattery() {
if (this.razerApplication.deviceManager.activeRazerDevices != null) {
this.razerApplication.deviceManager.activeRazerDevices.forEach(device => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last battery device will win the "tray competition"?
If so, I would filter the activeRazerDevices for device !== null && device.hasFeature(FeatureIdentifier.BATTERY) first before trying to compute the tray title.

Reason: Written like this, it will refresh every active device even though it might not even have a batteryLevel

return {
label: 'Battery level',
click() {
device.batteryLevelInterval = setInterval(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about creating this as a BatteryAnimation and add a stopAnimations() to class RazerDevice as well? You could call this.stopAnimations() inside of /*protected*/ setModeState(mode, modeArguments = null) and stop the BatteryAnimation there.
Don't forget a call to super.stopAnimations() in all classes which extend from RazerDevice and have the method stopAnimations() already.

function getFeatureBreath(application, device, feature) {
return {
label: 'Breathe',
click() {
if(device.batteryLevelInterval) clearInterval(device.batteryLevelInterval);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these lines are then not necessary if you go the BatteryAnimation way...

@AlexPerathoner
Copy link

Are there updates on this?

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

Successfully merging this pull request may close these issues.