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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception when a unifi config entry is ignored #45735

Merged
merged 2 commits into from Jan 30, 2021

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jan 30, 2021

Proposed change

Fix exception when a unifi config entry is ignored

Fixes

2021-01-30 07:10:34 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 46, in initialize
    await scanner.async_scan(None)
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 74, in async_scan
    await self._process_entries(entries)
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 120, in _process_entries
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 130, in async_init
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 213, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/unifi/config_flow.py", line 226, in async_step_ssdp
    if self._host_already_configured(self.config[CONF_HOST]):
  File "/usr/src/homeassistant/homeassistant/components/unifi/config_flow.py", line 249, in _host_already_configured
    if entry.data[CONF_CONTROLLER][CONF_HOST] == host:
KeyError: 'controller'

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 馃 Silver
  • 馃 Gold
  • 馃弳 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant probot-home-assistant bot added integration: unifi small-pr PRs with less than 30 lines. labels Jan 30, 2021
@project-bot project-bot bot added this to Needs review in Dev Jan 30, 2021
@bdraco bdraco added this to the 2021.2.0 milestone Jan 30, 2021
@bdraco
Copy link
Member Author

bdraco commented Jan 30, 2021

I need to write a test for this, but I need to sleep first

Dev automation moved this from Needs review to Reviewer approved Jan 30, 2021
Copy link
Member

@Kane610 Kane610 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be merged when test has been added 馃憤馃徎

@frenck frenck marked this pull request as draft January 30, 2021 11:31
@frenck
Copy link
Member

frenck commented Jan 30, 2021

Marking it draft :)

@bdraco bdraco marked this pull request as ready for review January 30, 2021 13:41
@bdraco
Copy link
Member Author

bdraco commented Jan 30, 2021

I fixed the existing test. Oops!

@Kane610
Copy link
Member

Kane610 commented Jan 30, 2021

LGTM!

@Kane610 Kane610 merged commit 88c4031 into home-assistant:dev Jan 30, 2021
Dev automation moved this from Reviewer approved to Done Jan 30, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants