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

Set Google Cast audio devices as speakers #73832

Merged
merged 3 commits into from
Jun 28, 2022

Conversation

felipecrs
Copy link
Contributor

@felipecrs felipecrs commented Jun 22, 2022

Breaking change

Proposed change

This will set proper icons to Google Cast audio-only devices, making it easier to distinguish TVs from Nest Minis for example.

As in YouTube Music app:

image

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.
  • 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

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

@felipecrs felipecrs changed the title Add cast_type attribute to Cast devices Display Google Cast audio devices as speakers Jun 22, 2022
@felipecrs
Copy link
Contributor Author

felipecrs commented Jun 22, 2022

I believe the correct would be to set Device Class to Speaker only, but for some reason, this does not cause the UI to show the speaker icon.

Multiple other integrations also set the speaker icon directly, most likely for the same reason.

@frenck
Copy link
Member

frenck commented Jun 22, 2022

I believe the correct would be to set Device Class to Speaker only, but for some reason, this does not cause the UI to show the speaker icon.

Multiple other integrations also set the speaker icon directly, most likely for the same reason.

Let's open up an issue @ the frontend or, even better, fix the frontend in that case. Working around it; will not improve the situation.

@felipecrs
Copy link
Contributor Author

felipecrs commented Jun 22, 2022

@frenck you are right. I updated the PR to only set the device_class, and not the icon.

I'm now also only setting device_class for speakers, as Pychromecast does not currently report whether the device is a Television or not:

@felipecrs felipecrs changed the title Display Google Cast audio devices as speakers Set Google Cast audio as speakers Jun 22, 2022
@felipecrs felipecrs changed the title Set Google Cast audio as speakers Set Google Cast audio devices as speakers Jun 22, 2022
@felipecrs
Copy link
Contributor Author

The frontend PR: home-assistant/frontend#12997

Copy link
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.

LGTM, Thanks @felipecrs 👍

@frenck frenck merged commit 4aa8570 into home-assistant:dev Jun 28, 2022
@felipecrs felipecrs deleted the nestmini-as-speaker branch June 28, 2022 21:38
@github-actions github-actions bot locked and limited conversation to collaborators Jun 29, 2022
@emontnemery
Copy link
Contributor

emontnemery commented Jul 7, 2022

This needs a test, can you please open a PR which adds one @felipecrs ?

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.

4 participants