jrfernandes / ontario_energy_board

Home Assistant component that installs a sensor with the current energy rate for Ontario energy companies
MIT License
41 stars 10 forks source link

Failing with HA 2023.8 #35

Closed bvanderlaan closed 7 months ago

bvanderlaan commented 10 months ago

I use the HA container and I just updated from 2023.7 to 2023.8 and noticed that this integration is no longer working.

In 2023.8 I see that Python 3.10 has been removed; now HA uses Python 3.11

I see an error log No module named 'hijri_converter' and notice that this module has also been deprecated in favour of hijridate.

I'm not super familiar with python or I'd help out

Logger: homeassistant.setup
Source: deps/lib/python3.11/site-packages/holidays/utils.py:20
First occurred: 6:25:04 PM (1 occurrences)
Last logged: 6:25:04 PM

Setup failed for custom integration ontario_energy_board: Unable to import component: No module named 'hijri_converter'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 813, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/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 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 "/config/custom_components/ontario_energy_board/__init__.py", line 8, in <module>
    from .coordinator import OntarioEnergyBoardDataUpdateCoordinator
  File "/config/custom_components/ontario_energy_board/coordinator.py", line 8, in <module>
    import holidays
  File "/config/deps/lib/python3.11/site-packages/holidays/__init__.py", line 13, in <module>
    from holidays.countries import *
  File "/config/deps/lib/python3.11/site-packages/holidays/countries/__init__.py", line 18, in <module>
    from .azerbaijan import Azerbaijan, AZ, AZE
  File "/config/deps/lib/python3.11/site-packages/holidays/countries/azerbaijan.py", line 18, in <module>
    from holidays.utils import islamic_to_gre
  File "/config/deps/lib/python3.11/site-packages/holidays/utils.py", line 20, in <module>
    from hijri_converter import convert
ModuleNotFoundError: No module named 'hijri_converter'
jrfernandes commented 9 months ago

Are you running the latest version (0.3.5, as of today)?

bvanderlaan commented 9 months ago

That is correct, I have version 0.3.5. I verified that I have the changes from cecc226 but I'm still seeing that log message and the integration is failing to load.

jrfernandes commented 7 months ago

Can you try again with release v0.3.6? I added the hijri_converter package to the dependencies list.

bvanderlaan commented 7 months ago

Verified. I redeployed the 2023.8 HA container with v0.3.6 and it works thank you.

FYI: I had to redeploy HA 2023.8 to test this as I've since upgraded to HA 2023.10 and v0.3.5 started working 🤷 (I meant to update the issue about that sorry). So maybe it was just an incompatibility between the 2023.8 container and v0.3.5 but not an issue with later container versions. Again 🤷, either way 2023.8 and v0.3.6 work 👍