rospogrigio / daikin_residential

Cloud control of Daikin devices that are supported by Daikin Residential Controller app.
GNU General Public License v3.0
282 stars 39 forks source link

[Issue]: Fail to start with HA 2024.2.0 #204

Closed bogdanioanliviu closed 9 months ago

bogdanioanliviu commented 9 months ago

With the version of HA 2024.2.0 core this integration fails with the following error:

2024-02-08 06:59:58.063 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'daikin_residential': Unable to import component: No module named 'oic'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 251, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 827, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/daikin_residential/__init__.py", line 13, in <module>
    from .daikin_api import DaikinApi
  File "/config/custom_components/daikin_residential/daikin_api.py", line 11, in <module>
    from oic.oic import Client
ModuleNotFoundError: No module named 'oic'

I think this is do to HA now using python 3.12. No diagnostics logs as the add-on it's not starting.

jwillemsen commented 9 months ago

Looks like oic is not installed, can you try pip install oic, see the python documentation

jeroen911 commented 9 months ago

I have the same problem, running home assistant in Docker. I reverted back to previous version.

`2024-02-08 13:55:53.489 ERROR (MainThread) [custom_components.daikin_residential.config_flow] Failed to initialize DaikinApi: client_cert has a type of <class 'NoneType'>, expected any of (<class 'str'>, <class 'tuple'>).

2024-02-08 13:55:56.594 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Daikin for daikin_residential Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 442, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikin_residential/init.py", line 84, in async_setup_entry daikin_api = DaikinApi(hass, entry) ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/daikin_residential/daikin_api.py", line 54, in init self.openIdClient = Client(client_id=self.openIdClientId, config=configuration) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/oic/oic/init.py", line 354, in init self.settings = settings or OicClientSettings() ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/oic/utils/settings.py", line 96, in init super().init( File "/usr/local/lib/python3.12/site-packages/oic/utils/settings.py", line 51, in init self.client_cert = client_cert ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/oic/utils/settings.py", line 73, in setattr raise SettingsException( oic.utils.settings.SettingsException: client_cert has a type of <class 'NoneType'>, expected any of (<class 'str'>, <class 'tuple'>).`

bogdanioanliviu commented 9 months ago

Looks like oic is not installed, can you try pip install oic, see the python

Y will try tomorrow

bogdanioanliviu commented 9 months ago

A new version of HA 2024.2.1 was release. This version fix the error for this integration. I think this can be closed. Thank you