frenck / spook

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

AttributeError: 'list' object has no attribute 'get' #180

Closed holdestmade closed 11 months ago

holdestmade commented 11 months ago

Getting this in logs, several times.

HA v2023.5.4 SPOOK v0.13.5791

Logger: custom_components.spook
Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:168
Integration: Spook ([documentation](https://github.com/frenck/spook), [issues](https://github.com/frenck/spook/issues))
First occurred: 15:00:11 (13 occurrences)
Last logged: 15:09:33

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0xffff444cef80>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
    await task
  File "/config/custom_components/spook/repairs/__init__.py", line 130, in _async_inspect
    await self.async_inspect()
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 108, in async_inspect
    for entity_id in self.__async_extract_entities(config)
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 156, in __async_extract_entities
    entities.update(self.__async_extract_entities_from_card(card))
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 206, in __async_extract_entities_from_card
    entities = self.__async_extract_common(config)
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 168, in __async_extract_common
    if entity := config.get(key):
AttributeError: 'list' object has no attribute 'get'
frenck commented 11 months ago

Thanks! Interesting and surely something I can safeguard 👍

../Frenck

pbranly commented 11 months ago

I have this message in the logs:

Logger: custom_components.spook
Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:153
Integration: Spook ([documentation](https://github.com/frenck/spook), [issues](https://github.com/frenck/spook/issues))
First occurred: 07:49:40 (6 occurrences)
Last logged: 10:18:36
Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7f3a680ed7e0>

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 117, in _handle_timer_finish
    await task
  File "/config/custom_components/spook/repairs/__init__.py", line 130, in _async_inspect
    await self.async_inspect()
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 108, in async_inspect
    for entity_id in self.__async_extract_entities(config)
  File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 153, in __async_extract_entities
    for badge in views.get("badges", []):
TypeError: 'NoneType' object is not iterable
frenck commented 11 months ago

Thanks for that addition @pbranly 👍

../Frenck