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

inspect failing on new install - KeyError: 'type' #58

Open
liljenstolpe opened this issue Feb 15, 2022 · 2 comments
Open

inspect failing on new install - KeyError: 'type' #58

liljenstolpe opened this issue Feb 15, 2022 · 2 comments

Comments

@liljenstolpe
Copy link

❯ streamdeckfs inspect
Found 1 Stream Deck(s):
* Deck AL46K2C82243
critical: Oops...
Traceback (most recent call last):
  File "/home/cdl/.local/lib/python3.10/site-packages/streamdeckfs/commands/__init__.py", line 26, in main
    cli()
  File "/home/cdl/.local/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/cdl/.local/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/cdl/.local/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/cdl/.local/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/cdl/.local/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/cdl/.local/lib/python3.10/site-packages/streamdeckfs/commands/inspect.py", line 28, in inspect
    click.echo(f"\t - Type: {info['type']}")
KeyError: 'type'
@liljenstolpe
Copy link
Author

I just checked, and the code where this is throwing is:

    for deck in decks.values():
        info = deck.info
        print( info )
        click.echo(f"* Deck {info['serial']}{'' if deck.info['connected'] else ' (already connected elsewhere)'}")
        click.echo(f"\t - Type: {info['type']}")
        click.echo(f"\t - ID: {info['id']}")
        click.echo(f"\t - Serial: {info['serial']}")
        click.echo(f"\t - Firmware Version: {info['firmware']}")
        click.echo(f"\t - Key Count: {info['nb_keys']} (in a {info['rows']}x{info['cols']} grid)")
        click.echo(f"\t - Key Images: {info['key_width']}x{info['key_height']} pixels, {info['format']} format")

        if deck.info["connected"]:
            Manager.close_deck(deck)

As you can see, I put a print( info ) in there to see what the returned dict is. The result is that there is no 'type' returned anymore. There is a 'model' which may be a replacement.

See the result:

❯ streamdeckfs inspect
Found 1 Stream Deck(s):
{'device': <StreamDeck.Devices.StreamDeckOriginalV2.StreamDeckOriginalV2 object at 0x7f98e251a740>, 'class': <class 'StreamDeck.Devices.StreamDeckOriginalV2.StreamDeckOriginalV2'>, 'model': 'StreamDeckOriginalV2', 'nb_keys': 15, 'nb_rows': 3, 'nb_cols': 5, 'format': 'JPEG', 'key_width': 72, 'key_height': 72, 'flip_horizontal': True, 'flip_vertical': True, 'rotation': 0, 'connected': True, 'serial': 'AL46K2C82243', 'id': '3-2.2.2.4:1.0', 'firmware': '1.02.005'}
* Deck AL46K2C82243
critical: Oops...

The remainder of the exception output is as above in the bug report.

@thamin-i
Copy link

thamin-i commented Oct 12, 2022

Hi !

As I have the same problem I would just like to add that it is also the case of the rows and cols keys.
Here are the new keys to use:

  • type => model
  • rows => nb_rows
  • cols => nb_cols

[edit] It should be fixed if we merge the #60 pull request

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

No branches or pull requests

2 participants