home-assistant-ecosystem / home-assistant-cli

:computer: Command-line tool for Home Assistant
Other
446 stars 69 forks source link

v0.9.0 throws `no attribute 'WS_TYPE_ENTITY_REGISTRY_GET'` #331

Closed haakonstorm closed 4 years ago

haakonstorm commented 4 years ago

λ hass-cli -x entity rename light.mini_sov light.bedroom_mini

 'homeassistant_cli.hassconst' has no attribute 'WS_TYPE_ENTITY_REGISTRY_GET'
Traceback (most recent call last):
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/homeassistant_cli/cli.py", line 40, in run
    result = cli.main(standalone_mode=False)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/homeassistant_cli/plugins/entity.py", line 81, in rename
    entity = api.get_entity(ctx, oldid)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/homeassistant_cli/remote.py", line 274, in get_entity
    frame = {'type': hass.WS_TYPE_ENTITY_REGISTRY_GET, 'entity_id': entity_id}
AttributeError: module 'homeassistant_cli.hassconst' has no attribute 'WS_TYPE_ENTITY_REGISTRY_GET'

λ python --version

Python 2.7.17

λ pyenv global 3.8.0 λ hass-cli -x entity rename light.mini_sov light.bedroom_mini

module 'homeassistant_cli.hassconst' has no attribute 'WS_TYPE_ENTITY_REGISTRY_GET'
Traceback (most recent call last):
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/homeassistant_cli/cli.py", line 40, in run
    result = cli.main(standalone_mode=False)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/homeassistant_cli/plugins/entity.py", line 81, in rename
    entity = api.get_entity(ctx, oldid)
  File "/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/homeassistant_cli/remote.py", line 274, in get_entity
    frame = {'type': hass.WS_TYPE_ENTITY_REGISTRY_GET, 'entity_id': entity_id}
AttributeError: module 'homeassistant_cli.hassconst' has no attribute 'WS_TYPE_ENTITY_REGISTRY_GET'

λ rg 'WS_TYPE_ENTITY_REGISTRY_GET' /usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages

/usr/local/Cellar/homeassistant-cli/0.9.0/libexec/lib/python3.8/site-packages/homeassistant_cli/remote.py
274:    frame = {'type': hass.WS_TYPE_ENTITY_REGISTRY_GET, 'entity_id': entity_id}
lmamakos commented 4 years ago

"me too" with python 3.6.9. The hass-cli version 0.7.0 was working just fine. Upon doing pip3 install -U homeassistant-cli I was getting this same error reported.