LaggAt / hacs-govee

A HACS repository for Govee light integration
MIT License
261 stars 60 forks source link

Govee integration breaks Roborock integration #169

Open r77s opened 2 months ago

r77s commented 2 months ago

Version of the custom_component:

When I install this integration with version 2023.11.1 and reboot my HA, this integration breaks the build in Roborock HA integration.

I tried also the Govee Lan integration, but it looks like the Govee intregations remove the imp module, so that the Roborock integration can not load correct.

``Logger: homeassistant.setup Quelle: setup.py:320 Erstmals aufgetreten: 09:46:44 (1 Vorkommnisse) Zuletzt protokolliert: 09:46:44

Setup failed for custom integration 'roborock': Unable to import component: No module named 'imp' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 320, in _async_setup_component component = await integration.async_get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1012, in async_get_component self._component_future.result() File "/usr/src/homeassistant/homeassistant/loader.py", line 992, in async_get_component comp = await self.hass.async_add_import_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1052, in _get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, 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 "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/roborock/init.py", line 10, in from roborock.api import RoborockApiClient File "/usr/local/lib/python3.12/site-packages/roborock/api.py", line 60, in from .protocol import Utils File "/usr/local/lib/python3.12/site-packages/roborock/protocol.py", line 12, in from construct import ( # type: ignore File "/usr/local/lib/python3.12/site-packages/construct/init.py", line 22, in from construct.core import File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 3, in import struct, io, binascii, itertools, collections, pickle, sys, os, tempfile, hashlib, importlib, imp ModuleNotFoundError: No module named 'imp'``

Describe the bug

A clear and concise description of what the bug is.

Debug log


Add your logs here.
JStaegerino commented 2 months ago

Same issue here. There is a Problem with the dacite Version from govee

Logger: homeassistant.config_entries Quelle: config_entries.py:594 Erstmals aufgetreten: 1. Juli 2024 um 15:33:32 (2 Vorkommnisse) Zuletzt protokolliert: 1. Juli 2024 um 15:44:36

Error setting up entry ---------------------------- for roborock Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/dacite/types.py", line 22, in extract_origin_collection return collection.extra ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'types.UnionType' object has no attribute 'extra'. Did you mean: 'str'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/roborock/containers.py", line 103, in from_dict return from_dict(cls, decamelize_obj(data, ignore_keys), config=Config(cast=[Enum])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dacite/core.py", line 64, in from_dict value = _buildvalue(type=field_type, data=field_data, config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dacite/core.py", line 101, in _build_value if issubclass(type, cast_type): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dacite/types.py", line 168, in is_subclass if is_generic_collection(sub_type): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dacite/types.py", line 147, in is_generic_collection origin = extract_origincollection(type) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dacite/types.py", line 24, in extract_origin_collection return collection.origin ^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'types.UnionType' object has no attribute 'origin'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/roborock/init.py", line 35, in async_setup_entry user_data = UserData.from_dict(entry.data[CONF_USER_DATA]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/roborock/containers.py", line 105, in from_dict raise RoborockException("It seems like you have an outdated version of dacite.") from err roborock.exceptions.RoborockException: It seems like you have an outdated version of dacite.

JStaegerino commented 2 months ago

It looks like this will work again with the Homeassistant Core 2024.7 update!

simongis commented 2 months ago

Same issue here, updated to 2024.7.0 now, but still encountering same issue setting up Roborock integration:

File "/usr/local/lib/python3.12/site-packages/roborock/containers.py", line 112, in from_dict raise RoborockException("It seems like you have an outdated version of dacite.") from err roborock.exceptions.RoborockException: It seems like you have an outdated version of dacite.

I do have the Govee custom integration 2023.11.1 via HACS.

Anyone got the two working or do I need to rollback to Xiaomi app/integration?

r77s commented 2 months ago

I am not sure what happends. After a few time uninstall the govee integration and the roborock integration and some reboots I can use both without any issue. Maybe the new HA version fixed it. I don't know what happends.

evergreen0057 commented 3 weeks ago

I am also encountering this issue. Everytime I have to restart HA I have to disable the Govee integration first > Restart HA > Wait for everything to load > Then enable Govee integration again afterwards and everything seems to works ok but this is a bit inconvenient and I often forget to disable it before a restart.

Is there any plan for a fix for this issue?