2023.10.4 shelly integration doesn' work at all #2217

Closed
opened 2023-10-27 18:44:17 +02:00 by zentoo · 3 comments

Fighting several days with this one but I haven't find a clue.

With USE=shelly app-misc/homeassistant I got the problem.
With USE=-shelly and deps directory populated with aioshelly-6.0.0 I got the problem too.

I can't delete the already configured integration in homeassistant and get the error message:
" Config flow could not be loaded: {"message":"Invalid handler specified"} "

So I decided to remove the integration configuration manually from .storage/core.config_entries then after restart of home assistant I could see that the integration have been removed. So I try to add shelly integration again and I get the same error message:
" Config flow could not be loaded: {"message":"Invalid handler specified"} "

From homeassistant log:

2023-10-27 18:24:16.237 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform homeassistant.components.shelly.config_flow
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/homeassistant/loader.py", line 838, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/homeassistant/loader.py", line 855, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/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 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  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 "/usr/lib/python3.11/site-packages/homeassistant/components/shelly/__init__.py", line 40, in <module>
    from .coordinator import (
  File "/usr/lib/python3.11/site-packages/homeassistant/components/shelly/coordinator.py", line 11, in <module>
    from aioshelly.ble import async_ensure_ble_enabled, async_stop_scanner
  File "/etc/homeassistant/deps/lib/python3.11/site-packages/aioshelly/ble/__init__.py", line 8, in <module>
    from bluetooth_data_tools import BLEGAPAdvertisement, parse_advertisement_data
  File "/usr/lib/python3.11/site-packages/bluetooth_data_tools/__init__.py", line 7, in <module>
    from .gap import (
  File "src/bluetooth_data_tools/gap.py", line 99, in init bluetooth_data_tools.gap
TypeError: 'type' object is not subscriptable
2023-10-27 18:24:16.241 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration shelly: Exception importing homeassistant.components.shelly.config_flow
Fighting several days with this one but I haven't find a clue. With USE=shelly app-misc/homeassistant I got the problem. With USE=-shelly and deps directory populated with aioshelly-6.0.0 I got the problem too. I can't delete the already configured integration in homeassistant and get the error message: `" Config flow could not be loaded: {"message":"Invalid handler specified"} "` So I decided to remove the integration configuration manually from .storage/core.config_entries then after restart of home assistant I could see that the integration have been removed. So I try to add shelly integration again and I get the same error message: `" Config flow could not be loaded: {"message":"Invalid handler specified"} "` From homeassistant log: ``` 2023-10-27 18:24:16.237 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform homeassistant.components.shelly.config_flow Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/homeassistant/loader.py", line 838, in get_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/homeassistant/loader.py", line 855, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/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 1126, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed 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 "/usr/lib/python3.11/site-packages/homeassistant/components/shelly/__init__.py", line 40, in <module> from .coordinator import ( File "/usr/lib/python3.11/site-packages/homeassistant/components/shelly/coordinator.py", line 11, in <module> from aioshelly.ble import async_ensure_ble_enabled, async_stop_scanner File "/etc/homeassistant/deps/lib/python3.11/site-packages/aioshelly/ble/__init__.py", line 8, in <module> from bluetooth_data_tools import BLEGAPAdvertisement, parse_advertisement_data File "/usr/lib/python3.11/site-packages/bluetooth_data_tools/__init__.py", line 7, in <module> from .gap import ( File "src/bluetooth_data_tools/gap.py", line 99, in init bluetooth_data_tools.gap TypeError: 'type' object is not subscriptable 2023-10-27 18:24:16.241 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration shelly: Exception importing homeassistant.components.shelly.config_flow ```
zentoo changed title from shelly integration doesn' work at all to 2023-10-4 shelly integration doesn' work at all 2023-10-27 18:51:23 +02:00
zentoo changed title from 2023-10-4 shelly integration doesn' work at all to 2023.10.4 shelly integration doesn' work at all 2023-10-27 18:51:39 +02:00
onkelbeh added the Bug label 2023-10-28 09:46:54 +02:00
Author

I've finally fixed this issue that I really need by forcing the use of dev-python/bluetooth-data-tools-1.12.0 instead of dev-python/bluetooth-data-tools-1.13.0.

I don't if 1.13.0 is mandatory for others USE:

# equery d bluetooth-data-tools
 * These packages depend on bluetooth-data-tools:
app-misc/homeassistant-2023.10.4 (~dev-python/bluetooth-data-tools-1.13.0)
                                 (bluetooth ? ~dev-python/bluetooth-data-tools-1.13.0)
                                 (esphome ? ~dev-python/bluetooth-data-tools-1.13.0)
dev-python/aioshelly-6.0.0 (>=dev-python/bluetooth-data-tools-0.3.0)
                           (test ? >=dev-python/bluetooth-data-tools-0.3.0)
I've finally fixed this issue that I really need by forcing the use of `dev-python/bluetooth-data-tools-1.12.0` instead of `dev-python/bluetooth-data-tools-1.13.0`. I don't if 1.13.0 is mandatory for others USE: ``` # equery d bluetooth-data-tools * These packages depend on bluetooth-data-tools: app-misc/homeassistant-2023.10.4 (~dev-python/bluetooth-data-tools-1.13.0) (bluetooth ? ~dev-python/bluetooth-data-tools-1.13.0) (esphome ? ~dev-python/bluetooth-data-tools-1.13.0) dev-python/aioshelly-6.0.0 (>=dev-python/bluetooth-data-tools-0.3.0) (test ? >=dev-python/bluetooth-data-tools-0.3.0) ```
Owner

I have excatly the same error, during the load of esphome #2234 and shelly #2233.
Tried a downgrade to dev-python/bluetooth-data-tools-1.12.0, did not help.

I have excatly the same error, during the load of esphome https://git.edevau.net/onkelbeh/HomeAssistantRepository/issues/2234 and shelly https://git.edevau.net/onkelbeh/HomeAssistantRepository/issues/2233. Tried a downgrade to `dev-python/bluetooth-data-tools-1.12.0`, did not help.
Owner

Hah, got it!

Hah, got it!
Sign in to join this conversation.
No labels Bug
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: onkelbeh/HomeAssistantRepository#2217