Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Irrigation_unlimited will not start in HomeAssistant version 2024.8.0b0 #174

Open
XerxesDGreat opened this issue Aug 1, 2024 · 5 comments

Comments

@XerxesDGreat
Copy link

Describe the bug
After upgrading to the latest homeassistant beta version, an error is shown in the Notifications and the plugin no longer functions

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to 2024.8.0b0
  2. Restart the HomeAssistant instance
  3. Wait for the database migration to complete
  4. Observe the logs

Expected behavior
Irrigation Unlimited should start with no errors

Screenshots
image

Irrigation Unlimited log file
These messages are very important in helping to determine the problem. Go into Settings -> System -> Logs. In the search box put in irrigation_unlimited (Note the underscore between the two words) and press the LOAD FULL LOGS button. Copy and paste below.


2024-08-01 10:38:54.661 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration irrigation_unlimited which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-08-01 10:39:07.571 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module with args ('custom_components.irrigation_unlimited',) in /usr/src/homeassistant/homeassistant/loader.py, line 1067: ComponentProtocol, importlib.import_module(self.pkg_path) inside the event loop; This is causing stability issues. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue
2024-08-01 10:39:07.585 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'irrigation_unlimited': Unable to import component: cannot import name 'DATA_INSTANCE' from 'homeassistant.components.recorder.const' (/usr/src/homeassistant/homeassistant/components/recorder/const.py)
File "/config/custom_components/irrigation_unlimited/__init__.py", line 13, in <module>
from .irrigation_unlimited import IUCoordinator
File "/config/custom_components/irrigation_unlimited/irrigation_unlimited.py", line 65, in <module>
File "/config/custom_components/irrigation_unlimited/history.py", line 7, in <module>
File "/config/custom_components/irrigation_unlimited/__init__.py", line 13, in <module>
from .irrigation_unlimited import IUCoordinator
File "/config/custom_components/irrigation_unlimited/irrigation_unlimited.py", line 65, in <module>
File "/config/custom_components/irrigation_unlimited/history.py", line 7, in <module>

Desktop (please complete the following information):

  • OS: MacOS 14.5
  • Browser: Arc (chromium-based)
  • Version 1.53.1

Smartphone (please complete the following information):

  • Device: iPhone 15 PRo
  • OS: iOS 17.5.1
  • Browser Home Assistant companion app
  • Version 2024.7

Additional context
Due to the database migration, it's unclear whether rolling back to a previous version of HomeAssistant functions. I will test this

@XerxesDGreat
Copy link
Author

XerxesDGreat commented Aug 1, 2024

looks like it's due to this constant being removed: home-assistant/core@2024.7.4...2024.8.0b0#diff-160724e1751b3cad9bbf4404c7f98416d09a60015a3cc07f4a7a307f9621db37L22

edit: thought this would link directly to the change since I copied the permalink, but alas!

Any rate, this is the change: home-assistant/core@5dbd768

@XerxesDGreat
Copy link
Author

XerxesDGreat commented Aug 2, 2024

I believe a simple change can be made which works on my local instance:

6 from homeassistant.util import dt
7 - from homeassistant.components.recorder.const import DATA_INSTANCE as RECORDER_INSTANCE
7 + from homeassistant.components.recorder import DATA_INSTANCE as RECORDER_INSTANCE
8 from homeassistant.components.recorder import get_instance

I can submit a merge request if you'd be amenable to that

@rgc99
Copy link
Owner

rgc99 commented Aug 2, 2024

Thanks, perhaps put a try/except incase someone updates/installs on an earlier HA version. I haven't tried it but something like this.

try:
    from homeassistant.components.recorder.const import DATA_INSTANCE as RECORDER_INSTANCE
except ImportError:
    from homeassistant.helpers.recorder import DATA_INSTANCE as RECORDER_INSTANCE

Always happy for some help.

@rgc99
Copy link
Owner

rgc99 commented Aug 4, 2024

I have added your changes. Thanks for your help in spotting this one.

@XerxesDGreat
Copy link
Author

XerxesDGreat commented Aug 5, 2024

no problem; that's a better fix. Thanks for adding it! (apologies for the delay; I was AFK for a couple days)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants