Skip to content

Squeezebox: Fix Allow server device details to merge with players with the same MAC #133517

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

Merged
merged 35 commits into from
Jun 30, 2025

Conversation

pssc
Copy link
Contributor

@pssc pssc commented Dec 18, 2024

Proposed change

Fixes a problem where a server and player would be merged into a single device / service
This is a different tack on #128989 that allows us to keep the server mac.

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)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

image

  • 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
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format 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.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @rajlaud, @peteS-UK, mind taking a look at this pull request as it has been labeled with an integration (squeezebox) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of squeezebox can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign squeezebox Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@pssc pssc changed the title Fix Squeezebox Disambiguate between servers and players to stop them being merged Squeezebox Fix disambiguate between servers and players to stop them being merged Dec 18, 2024
@peteS-UK
Copy link
Contributor

Something whacky with services vs devices. I see all of my software players as services. The only device is my one hardware player...

image

@pssc pssc marked this pull request as ready for review December 19, 2024 17:23
@rajlaud
Copy link
Contributor

rajlaud commented Dec 21, 2024

@pssc this seems to be a logical approach. It will allow us to associate entities with either the server or the player as appropriate. For example, the alarms show up as associated with the player in my alarms PR (#127933).

Screenshot 2024-12-21 at 1 28 45 PM

@peteS-UK maybe you need to delete add re-add your LMS server?

I'm seeing a software player (squeezelite) properly show up as a device and the server as a service.

Screenshot 2024-12-21 at 1 25 00 PM

@peteS-UK
Copy link
Contributor

@pssc this seems to be a logical approach. It will allow us to associate entities with either the server or the player as appropriate. For example, the alarms show up as associated with the player in my alarms PR (#127933).

Screenshot 2024-12-21 at 1 28 45 PM @peteS-UK maybe you need to delete add re-add your LMS server?

I'm seeing a software player (squeezelite) properly show up as a device and the server as a service.

Screenshot 2024-12-21 at 1 25 00 PM

Hi @rajlaud . No, it was a problem with an earlier version which Phil has already fixed.

@home-assistant home-assistant bot marked this pull request as draft December 21, 2024 22:06
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@pssc pssc marked this pull request as ready for review January 2, 2025 09:34
@home-assistant home-assistant bot requested a review from joostlek January 2, 2025 09:34
@pssc pssc marked this pull request as ready for review May 22, 2025 11:41
@pssc pssc requested a review from peteS-UK May 22, 2025 11:42
@emontnemery
Copy link
Contributor

emontnemery commented Jun 25, 2025

@pssc tests are failing, can you take a look? Please mark the PR "Ready for review" when you've addressed the failing tests.

@emontnemery emontnemery marked this pull request as draft June 25, 2025 09:59
@pssc
Copy link
Contributor Author

pssc commented Jun 26, 2025

Thanks @emontnemery fixed tests

@pssc pssc marked this pull request as ready for review June 26, 2025 18:58
@pssc pssc changed the title Squeezebox Fix Allow server device details to merge with players with the same MAC Squeezebox: Fix Allow server device details to merge with players with the same MAC Jun 27, 2025
@frenck frenck requested review from Copilot and removed request for peteS-UK June 27, 2025 08:14
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where a Squeezebox server and its player were being merged into a single device by preserving the server’s MAC details. The changes include renaming entity IDs in tests, updating snapshot expectations, and altering the device merging logic in the media player platform.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/components/squeezebox/test_switch.py Updated switch entity IDs from "test_player_alarm" to "none_alarm".
tests/components/squeezebox/test_media_player.py Added a test to ensure proper device registry merging for servers.
tests/components/squeezebox/test_button.py Updated button entity IDs accordingly.
tests/components/squeezebox/snapshots/test_switch.ambr Updated snapshot entries to reflect new naming.
tests/components/squeezebox/snapshots/test_media_player.ambr Adjusted snapshot expectations on device entries.
tests/components/squeezebox/conftest.py Modified TEST_MAC and adjusted server mock details.
homeassistant/components/squeezebox/media_player.py Revised the _player_discovered function to merge server and player info.
homeassistant/components/squeezebox/entity.py Removed direct device info attributes to favor merged details.
homeassistant/components/squeezebox/const.py Updated constant names to reflect server details.
homeassistant/components/squeezebox/init.py Updated server device creation with new manufacturer/model details.

frenck
frenck previously requested changes Jun 27, 2025
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.

Please make sure ruff/CI passes.

../Frenck

@home-assistant home-assistant bot marked this pull request as draft June 27, 2025 08:53
@pssc pssc marked this pull request as ready for review June 27, 2025 09:14
@home-assistant home-assistant bot requested a review from frenck June 27, 2025 09:14
Copy link
Contributor

@emontnemery emontnemery 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 @pssc 👍

@emontnemery
Copy link
Contributor

@peteS-UK @pssc I think this PR looks good. However, there's an unresolved conversation above: #133517 (comment)

Can you comment on if that's still relevant?

@emontnemery emontnemery merged commit 52a99ae into home-assistant:dev Jun 30, 2025
34 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 1, 2025
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.

6 participants