Schnitzel / hass-miner

Controll your Bitcoin miner from Home Assistant
MIT License
59 stars 19 forks source link

Adding Miner integration errors to "Invalid handler specified" #364

Closed adadnc closed 4 months ago

adadnc commented 4 months ago

After adding hass-miner's repository to HACS, adding the integration in '''Settings -> Device & Services -> Add Integration''' leads to the error Config flow could not be loaded: {"message":"Invalid handler specified"}

Version of the custom_component

Version 1.1.11

Configuration

No changes in configuration file made

Describe the bug

Steps to reproduce:

Debug log

Logger: homeassistant.loader
Source: loader.py:1247
First occurred: 16:41:18 (2 occurrences)
Last logged: 16:41:18

Unexpected exception importing platform custom_components.miner.config_flow
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1247, in _load_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1279, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/miner/__init__.py", line 4, in <module>
    import pyasic
  File "/usr/local/lib/python3.12/site-packages/pyasic/__init__.py", line 18, in <module>
    from pyasic.data import MinerData
  File "/usr/local/lib/python3.12/site-packages/pyasic/data/__init__.py", line 32, in <module>
    from pyasic.data.pools import PoolMetrics
  File "/usr/local/lib/python3.12/site-packages/pyasic/data/pools.py", line 35, in <module>
    @dataclass
     ^^^^^^^^^
  File "/usr/local/lib/python3.12/dataclasses.py", line 1275, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/usr/local/lib/python3.12/dataclasses.py", line 1265, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dataclasses.py", line 1063, in _process_class
    _init_fn(all_init_fields,
  File "/usr/local/lib/python3.12/dataclasses.py", line 585, in _init_fn
    raise TypeError(f'non-default argument {f.name!r} '
TypeError: non-default argument 'url' follows default argument
b-rowan commented 4 months ago

Already being tracked on pyasic. Will fix it quick.

https://github.com/UpstreamData/pyasic/issues/170

adadnc commented 4 months ago

Didn't know, sorry for that. Will you publish a new version with the fix or do you wait for more fixes? Having the Bitaxe in this integration makes it very interesting for many miners.

b-rowan commented 4 months ago

Not sure why this didn't close when I released the version, dangit GitHub 😅

Should be fixed in 1.1.12