core: Error while setting up unifi platform for switch

The problem

Error on async fetch from aiounifi to hass. This component worked in 0.113.3. Not working in 0.114.1. Not sure if it worked in 0.114.0.

Environment

arch: armv7l python: 3.8.3 supervisor: 232 core: 0.114.1

  • Home Assistant Core release with the issue: 0.114.1
  • Last working Home Assistant Core release (if known): 0.113.3 (maybe also 0.114.0)
  • Operating environment (OS/Container/Supervised/Core): Container
  • Integration causing this issue: Ubiquiti Unifi
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/unifi

Problem-relevant configuration.yaml


# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
  
homeassistant:
  customize: !include customize.yaml
  
weather:
  - platform: buienradar

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Traceback/Error logs

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 192, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 472, in _async_add_entity
    await entity.async_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/components/unifi/switch.py", line 173, in async_added_to_hass
    self.poe_mode = state.attributes["poe_mode"]
KeyError: 'poe_mode'

Additional information

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (12 by maintainers)

Most upvoted comments

I’ve published a PR that will fix the original issue of this reported issue. If you’re still experiencing your other issues mentioned here after this has been published please open new issues to keep them as small as possible in scope