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

Steam Deck fix #982

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

Steam Deck fix #982

wants to merge 2 commits into from

Conversation

DjUlt
Copy link

@DjUlt DjUlt commented Oct 22, 2024

Had issue with input-remapper-control
Crashed with error unsupported operand type(s) for 'in': 'str' and 'EnumType'
I added enum super class for Internals and Commands enum with 'in' implementation

changed enum global in case check strategy
added enum meta import
@sezanzeb
Copy link
Owner

sezanzeb commented Oct 23, 2024

I see, testing options.command in Commands seems to be a feature of newer python versions. Thanks for pointing out.

Though I feel like a solution that is a bit easier to understand would be:

from enum import Enum

class Commands(Enum):
    AUTOLOAD = "autoload"
    START = "start"
    STOP = "stop"
    STOP_ALL = "stop-all"
    HELLO = "hello"

print('autoload' in [command.value for command in Commands])  # True
print('asdf' in [command.value for command in Commands])  # False

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.

2 participants