Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'str' object has no attribute 'get' #188

Closed
holdestmade opened this issue Jun 1, 2023 · 6 comments · Fixed by #189
Closed

AttributeError: 'str' object has no attribute 'get' #188

holdestmade opened this issue Jun 1, 2023 · 6 comments · Fixed by #189

Comments

@holdestmade
Copy link

Getting this on v0.13.131314

Logger: custom_components.spook
Source: custom_components/spook/repairs/lovelace_unknown_entity_references.py:264
Integration: Spook (documentation, issues)
First occurred: 16:32:14 (8 occurrences)
Last logged: 16:34:12

Unexpected exception from <function AbstractSpookRepair.async_activate.._async_inspect at 0xffff5adcbd00>
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 159, 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 225, in __async_extract_entities_from_card
entities.update(self.__async_extract_entities_from_card(card))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 235, in __async_extract_entities_from_card
entities.update(self.__async_extract_entities_from_element(element))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 288, in __async_extract_entities_from_element
entities.update(self.__async_extract_entities_from_actions(config))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 255, in __async_extract_entities_from_actions
entities.update(self.__async_extract_entities_from_action(action))
File "/config/custom_components/spook/repairs/lovelace_unknown_entity_references.py", line 264, in __async_extract_entities_from_action
(target := config.get(key))
AttributeError: 'str' object has no attribute 'get'

@frenck
Copy link
Owner

frenck commented Jun 1, 2023

Do you have any action: in your YAML dashboards that have a string as a value?

@holdestmade
Copy link
Author

The only action: I can see is navigate, toggle, call-service and none. I did have a few null but have replaced them with none.

I do have a few action: double_tap but they are for custom restriction card

@frenck
Copy link
Owner

frenck commented Jun 1, 2023

I do have a few action: double_tap but they are for custom restriction card

That is the source 👍

Thanks!

../Frenck

@Mariusthvdb
Copy link

Mariusthvdb commented Jun 1, 2023

dont want to be daft, but what is the solution to this? Does Spook need to exclude those in the scan, or do we need to do anything in the action yaml...

not much we can do about correct config like:

action_default:
  tap_action:
    action: toggle
    haptic: light
  hold_action:
    action: more-info
    haptic: success

@frenck
Copy link
Owner

frenck commented Jun 1, 2023

No, this can be handled by Spook. I wasn't able to take into account all the custom stuff out there writing this 😉

Will maybe pick it up tomorrow (or something).

@Mariusthvdb
Copy link

a, great, would be nice!
thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants