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

error: TypeError: 'NoneType' object is not subscriptable #409

Open
johntdyer opened this issue Sep 24, 2023 · 3 comments
Open

error: TypeError: 'NoneType' object is not subscriptable #409

johntdyer opened this issue Sep 24, 2023 · 3 comments

Comments

@johntdyer
Copy link

I keep getting this error, but seemingly all other functions work fine..

░▒▓    ~ ▓▒░ hass-cli --loglevel debug entity list                ░▒▓ INT ✘  at 18:00:04  ▓▒░
debug: Using settings: <Configuration({'server': 'https://ha.xxxx.xxxxxx 'access-token': 'yes', 'api-password': 'no', 'insecure': False, 'output': 'auto', 'verbose': False})
debug: Setting auto-output to: table
debug: Using selector: KqueueSelector
error: TypeError: 'NoneType' object is not subscriptable
Run with -x to see full exception information
░▒▓    ~ ▓▒░
░▒▓    ~ ▓▒░ hass-cli -x entity list                                ░▒▓ 1 ✘  at 18:00:15  ▓▒░
'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/homeassistant_cli/cli.py", line 40, in run
    result = cli.main(standalone_mode=False)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/homeassistant_cli/plugins/entity.py", line 34, in listcmd
    entities = api.get_entities(ctx)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/homeassistant_cli/remote.py", line 291, in get_entities
    devices = cast(Dict[str, List[Dict[str, Any]]], wsapi(ctx, frame))[
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
░▒▓    ~ ▓▒░
@johntdyer
Copy link
Author

Anyone have any thoughts here? This still impacts me and I am unsure how to proceed

@johntdyer
Copy link
Author

Added some more logging and figured out that the error appears to be too many entities ???!!!

WSMessage(type=<WSMsgType.ERROR: 258>, data=WebSocketError(<WSCloseCode.MESSAGE_TOO_BIG: 1009>, 'Message size 4539129 exceeds limit 4194304'), extra=None)
'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/homeassistant_cli/cli.py", line 40, in run
    result = cli.main(standalone_mode=False)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/homeassistant_cli/plugins/entity.py", line 34, in listcmd
    entities = api.get_entities(ctx)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/homeassistant-cli/0.9.6_3/libexec/lib/python3.11/site-packages/homeassistant_cli/remote.py", line 293, in get_entities
    devices = cast(Dict[str, List[Dict[str, Any]]], wsapi(ctx, frame))[
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable```

@johntdyer
Copy link
Author

Seems fixed by #411

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

1 participant