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

Unexpected exception importing platform custom_components.weatherbit.sensor #93

Closed
gieljnssns opened this issue Dec 30, 2023 · 2 comments

Comments

@gieljnssns
Copy link

There is a new error with HA 2024.1b, weatherbit doesn't work anymore

Logger: homeassistant.loader
Source: loader.py:842
First occurred: December 29, 2023 at 17:09:46 (1 occurrences)
Last logged: December 29, 2023 at 17:09:46

Unexpected exception importing platform custom_components.weatherbit.sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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/weatherbit/sensor.py", line 84, in <module>
    @dataclass
     ^^^^^^^^^
  File "/usr/local/lib/python3.11/dataclasses.py", line 1230, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  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 'key' follows default argument
Logger: homeassistant.setup
Source: setup.py:403
First occurred: December 29, 2023 at 17:09:46 (2 occurrences)
Last logged: December 29, 2023 at 17:10:08

Unable to prepare setup for platform 'weatherbit.sensor': Platform not found (Exception importing custom_components.weatherbit.sensor).

Maybe this helps https://developers.home-assistant.io/blog/2023/12/11/entity-description-changes/

@briis briis linked a pull request Jan 5, 2024 that will close this issue
@nepozs
Copy link
Contributor

nepozs commented Jan 5, 2024

The version currently available as "master" seems to solve the problem (also with "stable" HA core 2024.1.0), but I will test it on a second installation.

edit: Update - Errors like:

Logger: homeassistant.loader
Source: loader.py:842
First occurred: 15:34:13 (1 occurrences)
Last logged: 15:34:13

Unexpected exception importing platform custom_components.weatherbit.sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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/weatherbit/sensor.py", line 84, in <module>
    @dataclass
     ^^^^^^^^^
  File "/usr/local/lib/python3.11/dataclasses.py", line 1230, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  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 'key' follows default argument

and

Logger: homeassistant.setup
Source: setup.py:403
First occurred: 15:34:13 (1 occurrences)
Last logged: 15:34:13

Unable to prepare setup for platform 'weatherbit.sensor': Platform not found (Exception importing custom_components.weatherbit.sensor).

has been fixed

also warning
warning-weatherbit-2024-01-05_18-13
has disappeared

edit2:

Tested also with HA core 2024.1.1

Thank you @briis
I think current version can be published (at least as beta, but most important issues are fixed, so maybe also as stable?)

@briis
Copy link
Owner

briis commented Jan 6, 2024

Closed with release 1.0.21

@briis briis closed this as completed Jan 6, 2024
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

Successfully merging a pull request may close this issue.

3 participants