uvjim/linksys_velop

linksys_velop.select error

Closed this issue · 3 comments

Hello Uvjim,

I update to Home Assistant 2022.11.0b0 (beta version) and got the following error:

Logger: homeassistant.setup
Source: setup.py:320
First occurred: 17:09:16 (2 occurrences)
Last logged: 17:09:16

Unable to prepare setup for platform linksys_velop.select: Platform not found (Exception importing custom_components.linksys_velop.select).

This error originated from a custom integration.

Logger: homeassistant.loader
Source: custom_components/linksys_velop/select.py:66
Integration: Linksys Velop (documentation, issues)
First occurred: 17:09:16 (2 occurrences)
Last logged: 17:09:16

Unexpected exception importing platform custom_components.linksys_velop.select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 728, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 745, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/linksys_velop/select.py", line 66, in <module>
    class LinksysVelopSelectDescription(
  File "/usr/local/lib/python3.10/dataclasses.py", line 1185, in dataclass
    return wrap(cls)
  File "/usr/local/lib/python3.10/dataclasses.py", line 1176, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
  File "/usr/local/lib/python3.10/dataclasses.py", line 1025, in _process_class
    _init_fn(all_init_fields,
  File "/usr/local/lib/python3.10/dataclasses.py", line 546, in _init_fn
    raise TypeError(f'non-default argument {f.name!r} '
TypeError: non-default argument 'key' follows default argument
uvjim commented

Cheers, I think I've found the problem. Previously the select entity didn't allow options in the description. I thought this was a little odd so I decided to path options into the description myself. Appears now, that someone had added this to core which is causing this issue.

I believe I've fixed it locally but need to test.

uvjim commented

Should be fixed by #310. This is on the main branch now.

It's working great now.
Thank you