Skip to content

Use enums in vizio#61996

Merged
frenck merged 8 commits intohome-assistant:devfrom
tkdrob:vizio1
Feb 15, 2022
Merged

Use enums in vizio#61996
frenck merged 8 commits intohome-assistant:devfrom
tkdrob:vizio1

Conversation

@tkdrob
Copy link
Copy Markdown
Contributor

@tkdrob tkdrob commented Dec 16, 2021

Breaking change

Proposed change

Use enums in vizio

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

  • 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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • 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
Copy link
Copy Markdown

Hey there @raman325, mind taking a look at this pull request as it has been labeled with an integration (vizio) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

Copy link
Copy Markdown
Contributor

@raman325 raman325 left a comment

Choose a reason for hiding this comment

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

Approved with the minor change

Co-authored-by: Raman Gupta <7243222+raman325@users.noreply.github.com>
): vol.All(
str,
vol.Lower,
vol.Coerce(MediaPlayerDeviceClass),
Copy link
Copy Markdown
Contributor

@epenet epenet Dec 16, 2021

Choose a reason for hiding this comment

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

This is a change of functionnality: it allows receiver and other future device classes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@raman325 was this voluntary? I missed the earlier conversation when I posted this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no that's a good point, I missed that receiver is also a device class. @tkdrob can we revert this commit?

@epenet
Copy link
Copy Markdown
Contributor

epenet commented Dec 16, 2021

One more thing: due to the changes to config_flow => please ensure this is tested thoroughly as I am not 100% sure how the config flow reacts with the new strEnum (see #61967).

@epenet
Copy link
Copy Markdown
Contributor

epenet commented Dec 20, 2021

It may be useful to rebase following #62363 as it impacts the way device classes are handled in the config flow.

if (
config.get(CONF_APPS) is not None
and config[CONF_DEVICE_CLASS] != DEVICE_CLASS_TV
and config[CONF_DEVICE_CLASS] is not MediaPlayerDeviceClass.TV
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we sure this will work? is config[CONF_DEVICE_CLASS] actually MediaPlayerDeviceClass.TV or the string?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right. I'll fix that.

@davet2001 davet2001 mentioned this pull request Jan 1, 2022
22 tasks
@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label Feb 14, 2022
Copy link
Copy Markdown
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks! 👍

@frenck frenck merged commit 7eed4af into home-assistant:dev Feb 15, 2022
@tkdrob tkdrob deleted the vizio1 branch February 15, 2022 12:12
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed code-quality integration: vizio small-pr PRs with less than 30 lines. smash Indicator this PR is close to finish for merging or closing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants