hass-magic_areas icon indicating copy to clipboard operation
hass-magic_areas copied to clipboard

Bug: AttributeError: 'list' object has no attribute 'items'

Open mszoernyi opened this issue 2 years ago • 4 comments

Describe the bug

After each reboot I get the following error which I can't figure out what is missing

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 397, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 641, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 775, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/magic_areas/binary_sensor.py", line 266, in async_added_to_hass
    await self._initialize()
  File "/config/custom_components/magic_areas/binary_sensor.py", line 291, in _initialize
    self.load_attributes()
  File "/config/custom_components/magic_areas/binary_sensor.py", line 226, in load_attributes
    ).items()
AttributeError: 'list' object has no attribute 'items'

Additional context

I've 10 areas with different devices like lights, media_player, sensors etc. Does every area require a motion/occupancy sensor? As some of my areas don't have one yet.

In general it might be a good idea to do a sanity check before depending on the items().

mszoernyi avatar Jul 23 '22 19:07 mszoernyi

Looks like your configuration is messed up. Are you coming up from 2.x?

Areas don't require motion/occupancy sensor.

jseidl avatar Jul 24 '22 07:07 jseidl

I had the 3.0.x beta running before. I will try to reset my config and see if that helps.

mszoernyi avatar Jul 25 '22 08:07 mszoernyi

Yeah 3.0 release broke the beta. Will need to recreate the areas

jseidl avatar Jul 25 '22 18:07 jseidl

Let me know when you're able to test it, if this still an issue.

jseidl avatar Jul 28 '22 05:07 jseidl