home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.06k stars 29.73k forks source link

Picnic todo list broken #115351

Open joostlek opened 5 months ago

joostlek commented 5 months ago

The problem

Whenever I try to add a basic item to the todo list, it will fail.

cc @DCSBL

What version of Home Assistant Core has the issue?

2024.4.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Picnic

Link to integration documentation on our website

https://www.home-assistant.io/integrations/picnic/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:1918
First occurred: 11:10:39 (1 occurrences)
Last logged: 11:10:39

websocket_api script: Error executing script. Error for call_service at pos 1: No product found or no product ID given

Additional information

No response

home-assistant[bot] commented 5 months ago

Hey there @corneyl, mind taking a look at this issue as it has been labeled with an integration (picnic) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `picnic` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign picnic` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


picnic documentation picnic source (message by IssueLinks)

DCSBL commented 5 months ago

Calling the service directly triggers this error:

Logger: homeassistant.components.websocket_api.http.connection
Bron: components/picnic/services.py:72
integratie: Home Assistant WebSocket API ([documentatie](https://www.home-assistant.io/integrations/websocket_api), [problemen](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
Eerst voorgekomen: 12:05:25 (1 gebeurtenissen)
Laatst gelogd: 12:05:25

[281471527831872] Error handling message: Unknown error (unknown_error) Duco from 77.63.35.237 (Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2024.4 (io.robbie.HomeAssistant; build:2024.624; iOS 17.4.1) Mobile/HomeAssistant, like Safari)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 794, in handle_execute_script
    script_result = await script_obj.async_run(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1650, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 454, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 506, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 536, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 504, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 733, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 696, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2542, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2579, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/picnic/services.py", line 37, in async_add_product_service
    await handle_add_product(hass, api_client, call)
  File "/usr/src/homeassistant/homeassistant/components/picnic/services.py", line 72, in handle_add_product
    raise PicnicServiceException("No product found or no product ID given!")
homeassistant.components.picnic.services.PicnicServiceException: No product found or no product ID given!
DCSBL commented 5 months ago

The app itself still works, so this maybe indicates the search API has been changed. This part was developed by @Corneyl, maybe you can take a quick look in this?

(I only implemented search into ‘todo’).

corneyl commented 5 months ago

The answer is in the stack trace, especially this part:

homeassistant.components.picnic.services.PicnicServiceException: No product found or no product ID given!

Maybe something changed in Picnic's API so it cannot find any products anymore, I'd have to check this.

freakshock88 commented 4 months ago

Noticed this as well. See this issue for reference.

Doemas commented 3 months ago

@corneyl Any updates on this issue?

freakshock88 commented 3 months ago

It seems that there is an open PR for the library that should fix the issue but the author has not responded to the PR yet. I tried to contact the author in the PR here: https://github.com/MikeBrink/python-picnic-api/pull/25

Doemas commented 2 weeks ago

@corneyl Could you please take a look at the above PR? Would like to be able to use this integration again. Thanks.