elad-bar / ha-shinobi

Shinobi Video custom component for HA
53 stars 5 forks source link

Unexpected exception importing component on HA ver. 2024.1.0b0 #62

Closed chemelli74 closed 10 months ago

chemelli74 commented 11 months ago

Import error on latest beta:

2023-12-28 09:50:22.061 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component custom_components.shinobi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 822, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/shinobi/__init__.py", line 14, in <module>
    from .common.entity_descriptions import PLATFORMS
  File "/config/custom_components/shinobi/common/entity_descriptions.py", line 41, in <module>
    @dataclass(slots=True)
     ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dataclasses.py", line 1220, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dataclasses.py", line 1027, in _process_class
    _init_fn(all_init_fields,
  File "/usr/local/lib/python3.11/dataclasses.py", line 545, in _init_fn
    raise TypeError(f'non-default argument {f.name!r} '
TypeError: non-default argument 'entity_category' follows default argument
2023-12-28 09:50:22.166 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'shinobi': Unable to import component: Exception importing custom_components.shinobi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 822, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "/config/custom_components/shinobi/__init__.py", line 14, in <module>
    from .common.entity_descriptions import PLATFORMS
     ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dataclasses.py", line 1220, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
  File "/usr/local/lib/python3.11/dataclasses.py", line 545, in _init_fn
    raise TypeError(f'non-default argument {f.name!r} '
The above exception was the direct cause of the following exception:

Traceback (most recent call last):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 830, in get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
elad-bar commented 11 months ago

Which version of HA are you using?

chemelli74 commented 11 months ago

Which version of HA are you using?

HA ver. 2024.1.0b0 (as reported in the title)

elad-bar commented 10 months ago

missed it, thanks for the heads up, got lot of work for this weekend :)

elad-bar commented 10 months ago

pls check with v3.0.6

chemelli74 commented 10 months ago

image

Will test manually asap

elad-bar commented 10 months ago

I set it as minimum 2024.1.0, can't set ot to beta, You can force install it or download and update manually, In my testing env. it is working, also updated 9 other integrations, thanks again

elad-bar commented 10 months ago

can I close this issue?

thanks

chemelli74 commented 10 months ago

All working fine for a couple of days, thx for fixing so fast