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

Add config flow for braviatv integration #33774

Merged
merged 41 commits into from
Apr 14, 2020
Merged

Add config flow for braviatv integration #33774

merged 41 commits into from
Apr 14, 2020

Conversation

bieniu
Copy link
Member

@bieniu bieniu commented Apr 7, 2020

Breaking change

Configuration of new instances will only be possible through Integration due to the lack of the bravia.conf file, which is necessary for YAML configuration. Existing instances will be imported into config_entry.

Proposed change

This PR:

  • adds config flow support
  • adds ignored sources via options flow
  • adds missing device_class property to the entity class

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

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

@probot-home-assistant
Copy link

Hey there @robbiet480, mind taking a look at this pull request as its been labeled with a integration (braviatv) you are listed as a codeowner for? Thanks!

@bieniu
Copy link
Member Author

bieniu commented Apr 7, 2020

@dcnielsen90 Could you take a look?

@dcnielsen90
Copy link
Contributor

My only comment was going to be the breaking change part -- but you beat me to it. The docs will need to be updated.

Otherwise the config_flow and options work nicely. Nothing jumped out at me that might cause issues later. One thing that was kind of annoying was selecting all the sources I’d want to ignore – the list of sources I’d want to include is significantly shorter. It works either way (include vs exclude) and if it works nicely for the everyone else, I wouldn’t change it – I just probably would have done it the other way.

@bieniu
Copy link
Member Author

bieniu commented Apr 7, 2020

@dcnielsen90 As for the source list. In my opinion, apps on the source list aren't a good solution because we aren't able to check which app is currently running. For example, we change the source to Netflix, Netflix starts, but in the integration the source attribute remains empty because the integration doesn't get information about the running app from the TV. It seems to me that we should remove applications from the source list and add the service braviatv.start_app to start the app. What do you think about it? I can take care of it in the next step.

homeassistant/components/braviatv/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/braviatv/config_flow.py Outdated Show resolved Hide resolved
Dev automation moved this from Needs review to Review in progress Apr 7, 2020
homeassistant/components/braviatv/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/braviatv/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/braviatv/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/braviatv/manifest.json Outdated Show resolved Hide resolved
homeassistant/components/braviatv/media_player.py Outdated Show resolved Hide resolved
tests/components/braviatv/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/braviatv/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/braviatv/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/braviatv/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/braviatv/test_config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/braviatv/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/braviatv/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/braviatv/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/braviatv/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/braviatv/media_player.py Outdated Show resolved Hide resolved
tests/components/braviatv/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/braviatv/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/braviatv/test_config_flow.py Outdated Show resolved Hide resolved
Copy link
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.

Great!

@MartinHjelmare MartinHjelmare merged commit 6dc6f2d into home-assistant:dev Apr 14, 2020
Dev automation moved this from Review in progress to Done Apr 14, 2020
@bieniu bieniu deleted the bravia-config-flow branch April 15, 2020 05:27
@lock lock bot locked and limited conversation to collaborators Apr 19, 2020
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

6 participants