Skip to content

Skip ignored hosts when checking existing config entries in config flow#34280

Merged
balloob merged 7 commits intohome-assistant:devfrom
raman325:vizio_bugfix
Apr 16, 2020
Merged

Skip ignored hosts when checking existing config entries in config flow#34280
balloob merged 7 commits intohome-assistant:devfrom
raman325:vizio_bugfix

Conversation

@raman325
Copy link
Copy Markdown
Contributor

Proposed change

There was a bug report that pointed out that when a vizio device has been ignored, config flow will fail because it expected the host key but the ignored config entry doesn't have it. This change only checks for expected keys when the config entry is not an ignored one. I wasn't sure how to test this, I found that the config component does a test like this by calling the WebSocket client to ignore an entry but that seemed messy. Happy to add tests if needed. If there's another hotfix version released for 0.108, it would be great to include this in that, otherwise it should go out with 0.109

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

Additional information

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

Comment thread homeassistant/components/vizio/config_flow.py Outdated
@MartinHjelmare
Copy link
Copy Markdown
Member

Could we test this by adding a MockConfigEntry with source ignore and then starting the flow in the different entry points?

@raman325
Copy link
Copy Markdown
Contributor Author

Thanks for that suggestion @MartinHjelmare was struggling to figure out how to test this, and by adding tests I found that my logic was flawed. Pushing a new commit shortly

Comment thread homeassistant/components/vizio/config_flow.py Outdated
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Looks good!

@balloob balloob added this to the 0.108.6 milestone Apr 16, 2020
@balloob balloob merged commit ca67fd9 into home-assistant:dev Apr 16, 2020
Comment thread homeassistant/components/vizio/config_flow.py
@raman325 raman325 deleted the vizio_bugfix branch April 16, 2020 22:00
@balloob balloob mentioned this pull request Apr 17, 2020
@lock lock Bot locked and limited conversation to collaborators Apr 19, 2020
@balloob balloob added the bugfix label May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vizio TV won't integrate with Hass.io

4 participants