sander1988 / Indego

Home Assistant Custom Component for Bosch Indego Lawn Mower
Apache License 2.0
95 stars 29 forks source link

Indego integration not working after update to HA 2024.11 #251

Open wimb0 opened 1 day ago

wimb0 commented 1 day ago

Checklist

The problem

Indego Integration does not start on Home Assistant 2024.11

Expected behavior

A working integration

Steps to reproduce

Update to HA 2024.11

Environment

Logs

Logger: homeassistant.config_entries
Bron: config_entries.py:3227
Eerst voorgekomen: 09:28:40 (3 gebeurtenissen)
Laatst gelogd: 09:28:51

Error occurred loading flow for integration indego: cannot import name 'DATA_STORAGE' from 'homeassistant.components.application_credentials' (/usr/src/homeassistant/homeassistant/components/application_credentials/__init__.py)
Logger: homeassistant.config_entries
Bron: config_entries.py:604
Eerst voorgekomen: 09:21:30 (2 gebeurtenissen)
Laatst gelogd: 09:24:22

Error importing platform config_flow from integration indego to set up indego configuration entry: cannot import name 'DATA_STORAGE' from 'homeassistant.components.application_credentials' (/usr/src/homeassistant/homeassistant/components/application_credentials/__init__.py)
Logger: homeassistant.util.loop
Bron: util/loop.py:136
Eerst voorgekomen: 09:24:22 (1 gebeurtenissen)
Laatst gelogd: 09:24:22

Detected blocking call to import_module with args ('custom_components.indego.config_flow',) inside the event loop by integration 'config' at homeassistant/components/config/config_entries.py, line 120: await hass.config_entries.async_reload(entry_id) (offender: /usr/src/homeassistant/homeassistant/loader.py, line 1300: return importlib.import_module(f"{self.pkg_path}.{platform_name}")), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+config%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 559, in _handle return await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 120, in post await hass.config_entries.async_reload(entry_id)

Additional information

Tried removing and re-installing the integration, but that throws the same errors as above.

kimzeuner commented 1 day ago

i had the same error this morning after upgrading to 2024.11.0 Seems as changing line 9 in custom_components/indego/config_flow.py from

from homeassistant.components.application_credentials import ClientCredential, async_import_client_credential, DOMAIN as AC_DOMAIN, DATA_STORAGE as AC_DATA_STORAGE

to

from homeassistant.components.application_credentials import ClientCredential, async_import_client_credential, DOMAIN as AC_DOMAIN, DATA_COMPONENT as AC_DATA_STORAGE

fixed it. Maybe @sander1988 can check if this is all that has to be changed ?! Should i write a PR or will you do the change ?

LarsLautrup commented 1 day ago

i had the same error this morning after upgrading to 2024.11.0 Seems as changing line 9 in custom_components/indego/config_flow.py

I can confirm, that this does indeed fix the problem. Thanks!! 👍

Lehcsi1984 commented 1 day ago

same error this morning after upgrading to 2024.11.0. i tryed changing line 9. Not Working.

When i try to add the indego integration: "500 Internal Server Error Server got itself in trouble"

Indego component release with the issue: 5.7.5 Last working Indego component release (if known):5.7.5 Home Assistant release with the issue: 2024.11.0 Last working Home Assistant release (if known): 2024.10.3 Operating system: HOAS OS on Pi5 8Gb

wimb0 commented 1 day ago

I tried the fix from @kimzeuner , but I also get the "500 Internal Server Error Server got itself in trouble"

I the logs the following error is then found:

Logger: aiohttp.server
Bron: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:448
Eerst voorgekomen: 13:21:29 (3 gebeurtenissen)
Laatst gelogd: 13:22:57

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 559, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 172, in post
    return await self._post_impl(request, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 179, in _post_impl
    return await super()._post_impl(request, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 84, in _post_impl
    result = await self._flow_mgr.async_init(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1301, in async_init
    flow, result = await self._async_init(flow_id, handler, context, data)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1336, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/indego/config_flow.py", line 130, in async_step_user
    credentials = self.hass.data[AC_DOMAIN][AC_DATA_STORAGE].async_client_credentials(DOMAIN)
                  ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
TypeError: 'ApplicationCredentialsStorageCollection' object is not subscriptable 
Lehcsi1984 commented 5 hours ago

Hy. I was wrong. I allready deleted the indego integration. After a restore and editing the Line 9....working. Dont deleted the indego entity or integration. Just edit and restart.