Automatically detect device class in vizio config flow - #177642
Open
raman325 wants to merge 1 commit into
Open
Conversation
Remove the device type selector from the user flow and detect whether the device is a TV or a speaker with the same probe zeroconf discovery already uses. A wrong guess cannot create a bad entry since the serial number fetch validates reachability right after. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
raman325
marked this pull request as ready for review
July 30, 2026 12:48
21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Follow-up to the review discussion on #177590, where @gjohansson-ST asked whether the reconfigure flow should also cover device class/token. Rather than exposing the device class in more flows, this PR removes the "Device type" selector from the config flow entirely and detects it automatically. A revised reconfigure flow building on this will come in a separate PR — the scope here is intentionally only the auto-classification.
strings.jsonentry and theDEFAULT_DEVICE_CLASSconstant.async_is_tv, which makes a single unauthenticated request to the SmartCast audio-settings endpoint (sound bars answer without auth, TVs reject it until paired)._async_detect_device_classhelper, which also passes Home Assistant's shared aiohttp session intoasync_is_tv(the zeroconf path previously created its own session).cannot_connectif the device isn't reachable.device_classremains stored in entry data). Not a breaking change — the setup form simply has one fewer field.vizio_detect_tvfixture was added, and the two user-form-path tests now cover both detection outcomes (TV and speaker). All 82 vizio tests pass locally.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: