slesinger / HomeAssistant-PREdistribuce

Home Assistant integration to display info about energy plan
https://slesinger.info
Apache License 2.0
11 stars 7 forks source link

Integration not working with HA 2024.1.0 #18

Open Plawasan opened 10 months ago

Plawasan commented 10 months ago

After updating to 2024.1.0, all sensors are unavailable, this is what logs say:

Logger: homeassistant.util.package
Source: util/package.py:102
First occurred: 09:13:14 (3 occurrences)
Last logged: 09:13:19

Unable to install package lxml==4.9.1: ERROR: Cannot install lxml==4.9.1 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Logger: homeassistant.config
Source: config.py:1258
First occurred: 09:13:19 (1 occurrences)
Last logged: 09:13:19

Platform error: binary_sensor - Requirements for predistribuce not found: ['lxml==4.9.1'].

Diky

mazzy89 commented 10 months ago

Simply just update the lxml dependency to 4.9.4.

mazzy89 commented 10 months ago

Created a PR to address this https://github.com/slesinger/HomeAssistant-PREdistribuce/pull/19

Plawasan commented 10 months ago

Thanks, I've updated the manifest manually, works now.

kimosak commented 1 month ago

Similar issue after update on HA 2024.10.0 Platform error 'binary_sensor' from integration 'predistribuce' - cannot import name 'etree' from 'lxml' (/usr/local/lib/python3.12/site-packages/lxml/__init__.py) Platform error 'sensor' from integration 'predistribuce' - cannot import name 'etree' from 'lxml' (/usr/local/lib/python3.12/site-packages/lxml/__init__.py) Tried to update lxml but no change pip install lxml Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: lxml in /usr/lib/python3/dist-packages (4.6.3)

mazzy89 commented 3 weeks ago

@kimosak do you have still the issue?

kimosak commented 3 weeks ago

@mazzy89 yes, "sensor" not working from 2024.10 to 2024.10.3

Logger: homeassistant.config Zdroj: config.py:1413 První výskyt: 21. října 2024 v 22:21:04 (1 výskyty) Naposledy logováno: 21. října 2024 v 22:21:04

Platform error: binary_sensor - cannot import name 'etree' from 'lxml' (/usr/local/lib/python3.12/site-packages/lxml/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 1413, in _async_load_and_validate_platform_integration
    platform = await p_integration.integration.async_get_platform(domain)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1100, in async_get_platform
    platforms = await self.async_get_platforms((platform_name,))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1177, in async_get_platforms
    import_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1165, in async_get_platforms
    platforms.update(self._load_platforms(platform_names))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1090, in _load_platforms
    platform_name: self._load_platform(platform_name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, 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 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/predistribuce/binary_sensor.py", line 12, in <module>
    from lxml import html, etree
  File "/usr/local/lib/python3.12/site-packages/lxml/html/__init__.py", line 53, in <module>
    from .. import etree
ImportError: cannot import name 'etree' from 'lxml' (/usr/local/lib/python3.12/site-packages/lxml/__init__.py)
mazzy89 commented 3 weeks ago

I cannot reproduce on my side. Can you report which lxml version do you have?

kimosak commented 3 weeks ago

I hope this one is the current one lxml in /usr/lib/python3/dist-packages (4.6.3)

kimosak commented 2 weeks ago

@mazzy89 lxml updated to 5.3.0 but there is still error Platform error 'binary_sensor' from integration 'predistribuce' - cannot import name 'etree' from 'lxml' (/usr/local/lib/python3.12/site-packages/lxml/__init__.py)

mazzy89 commented 2 weeks ago

how have you installed HA?

kimosak commented 2 weeks ago

I used phoscon image based on Raspberry Pi OS and docker

Operating System: Raspbian GNU/Linux 11 (bullseye) Kernel: Linux 6.6.47-v8+

Client: Docker Engine - Community Version: 26.1.4 API version: 1.45 Go version: go1.21.11 Git commit: 5650f9b Built: Wed Jun 5 11:28:55 2024