frenck / spook

A scary 👻 powerful toolbox 🧰 for Home Assistant 🏡
https://spook.boo
MIT License
381 stars 36 forks source link

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7feaf818e160> #635

Closed DaN66O closed 1 month ago

DaN66O commented 2 months ago

What version of Spook are you using?

v2.2.2

What version of Home Assistant are you using?

core-2024.2.3

The problem

I see the following error in the log

Anything in the logs? Paste it here!

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7feaf818e160>
Traceback (most recent call last):
  File "/opt/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/debounce.py", line 114, in _handle_timer_finish
    await task
  File "/opt/homeassistant/config/custom_components/spook/repairs.py", line 149, in _async_inspect
    await self.async_inspect()
  File "/opt/homeassistant/config/custom_components/spook/ectoplasms/automation/repairs/unknown_device_references.py", line 38, in async_inspect
    self.hass, device_ids=entity.referenced_devices
                          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.12/site-packages/homeassistant/backports/functools.py", line 70, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.12/site-packages/homeassistant/components/automation/__init__.py", line 500, in referenced_devices
    referenced = self.action_script.referenced_devices
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.12/site-packages/homeassistant/backports/functools.py", line 70, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1409, in referenced_devices
    Script._find_referenced_devices(referenced_devices, self.sequence)
  File "/opt/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1425, in _find_referenced_devices
    _referenced_extract_ids(data, ATTR_DEVICE_ID, referenced)
  File "/opt/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1210, in _referenced_extract_ids
    for item_id in item_ids:
TypeError: 'int' object is not iterable
frenck commented 1 month ago

Hi there @DaN66O 👋

  File "/opt/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1210, in _referenced_extract_ids
    for item_id in item_ids:
TypeError: 'int' object is not iterable

Unfortunately, this is an error occurring in the Home Assistant codebase. There is not much I can do about this from this end.

Sorry! 🙏

../Frenck