AlexxIT / YandexStation

Управление Яндекс.Станцией и другими устройствами умного дома с Алисой из Home Assistant
https://t.me/AlexxIT_SmartHome
MIT License
1.27k stars 119 forks source link

Shopping List update fail #481

Closed AlexQuaken closed 3 months ago

AlexQuaken commented 3 months ago

Some time ago, the shopping list synchronization stopped working, although it was functioning properly before. Now, when calling the script for list synchronization, Alice simply recites her list without actually synchronizing it. The logs show the following error:

2024-03-25 15:31:00.874 ERROR (MainThread) [homeassistant.components.script.update_shopping_list] Обновить список покупок: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action return long_task.result() ^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/yandex_station/core/yandex_station.py", line 858, in async_play_media await self._shopping_list() File "/config/custom_components/yandex_station/core/yandex_station.py", line 419, in _shopping_list alice_list = RE_SHOPPING.findall(card["text"])


TypeError: 'NoneType' object is not subscriptable

script:
  update_shopping_list:
    alias: Обновить список покупок
    sequence:
      - service: media_player.play_media
        entity_id: media_player.yandex_station_2410789XXXXXXXXXXXX
        data:
          media_content_id: update
          media_content_type: shopping_list
AlexxIT commented 3 months ago

471