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

Additional effects for Razer Kraken Kitty Edition #438

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

Conversation

ineffyble
Copy link

@ineffyble ineffyble commented Aug 22, 2021

Add "Starlight", "Wave", and "Spectrum" effects for the Razer Kraken Kitty Edition.

Reliant on 1kc/librazermacos#10.

I took the liberty of refactoring the per-device features which has been unused since the introduction of featureConfig and was a more verbose version of same.

Fixes #411.

@ineffyble ineffyble changed the title Feature/additional razer kraken kitty effects Additional effects for Razer Kraken Kitty Edition Aug 22, 2021
@1kc
Copy link
Owner

1kc commented Aug 22, 2021

Nice work! I will have a look through tomorrow

@ineffyble
Copy link
Author

Worth noting that based on this we should probably be removing Spectrum from the Headphone defaults and adding it to the Kraken V2 specifically (or adding it as "missing" from the other headphones).

static createFeatureFrom(featureConfig) {
const featureIdentifier = Object.keys(featureConfig)[0];
const configuration = featureConfig[featureIdentifier];
static createFeatureFrom(featureIdentifier) {
Copy link
Owner

Choose a reason for hiding this comment

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

Hopefully this change doesn't affect other devices? I'll test it with my keyboard tonight.

Copy link
Author

Choose a reason for hiding this comment

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

@1kc It doesn't because no other devices use this. Every other device JSON has "features": null.

Copy link
Author

Choose a reason for hiding this comment

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

Worth noting that based on this we should probably be removing Spectrum from the Headphone defaults and adding it to the Kraken V2 specifically (or adding it as "missing" from the other headphones).

Should we do that as a result of this change? Do you mind having a look through in that case then

No problems, will do.

Copy link
Collaborator

@dhobi dhobi Aug 23, 2021

Choose a reason for hiding this comment

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

@1kc It doesn't because no other devices use this. Every other device JSON has "features": null.

It's more about the property "featuresConfig" here which allows to configure the features. If I see it correctly, your change would remove this.

Copy link
Author

@ineffyble ineffyble Aug 23, 2021

Choose a reason for hiding this comment

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

@dhobi "featuresConfig" is applied via a separate function and doesn't use createFeatureFrom - it overrides the config on existing features: https://github.com/1kc/razer-macos/pull/438/files#diff-725951effb09a2201fc24d3dbc718b13771f12d775260c3fc14668d2ca873014R138

There was a lot of duplication between this and that when that one was created.

Effectively the way it works right now:

  • Features are instantiated, either with no config if "features" is null and the default for main type is used, or the configuration from the relevant key under "features"
  • If "featuresMissing" is defined, any features in that array are removed
  • If "featuresConfig" is defined, we find the matching instantiated feature and override the config

This PR separates out instantiation from config, rather than "features" and "featuresConfig" both being responsible for defining feature configuration.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahh yes, I see now that the configs are overridden later if needed. Thanks for pointing this out.

We might just get rid of the config parameter in the constructor in this case? We can easily do this in a separate step as well. What do you think?

Copy link
Author

Choose a reason for hiding this comment

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

Makes sense to me, don't think it is used anywhere.

Copy link
Owner

Choose a reason for hiding this comment

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

All good to merge?

@1kc
Copy link
Owner

1kc commented Aug 23, 2021

Worth noting that based on this we should probably be removing Spectrum from the Headphone defaults and adding it to the Kraken V2 specifically (or adding it as "missing" from the other headphones).

Should we do that as a result of this change? Do you mind having a look through in that case then

@WrathofthePast
Copy link
Collaborator

@ineffyble, can this be merged?

@ghost
Copy link

ghost commented May 17, 2022

Hello! I wanted to open a ticket for this bug, I am really late but do you think you will merge this one? Regards.

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.

Razer Kraken Kitty Spectrum not working
4 participants