Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Expose Songpal enumTarget settings via select entities #147230

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

Draft
wants to merge 17 commits into
base: dev
Choose a base branch
from

Conversation

YoshiWalsh
Copy link

@YoshiWalsh YoshiWalsh commented Jun 20, 2025

Proposed change

Based on feedback for #147217 I have split my contribution into multiple smaller PRs. This is PR 4/6. PR #147237 should be merged first!

This PR:

Adds select entities for enumTarget settings

Overall changes: (across all 6 PRs)

With these changes, additional entities are created to expose enum, boolean, string, and integer settings based on whatever the Songpal device supports.

My motivation for making this was because I wanted to be able to control night mode, voice enhancement, and subwoofer level from Home Assistant.

Before:
image

After:
image

The additional entities may differ from device to device, so are generated dynamically based on what python-songpal reports as available.

(I don't expose playback_settings because these settings are duplicated for each input source, which seemed a bit messy. I also don't expose speaker_settings because it was giving me an Invalid Argument error and so was impossible for me to test with my device.)

I believe this change maintains backwards compatibility (existing entity unique IDs should not change, existing services are conserved).

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

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:

Also prepares re-usable functionality which will be used to create additional entities to expose various Songpal settings.

Since this is a significant refactoring, I have also added myself to the codeowners list to indicate my willingness to provide ongoing support.
@home-assistant
Copy link

Hey there @rytilahti, @shenxn, mind taking a look at this pull request as it has been labeled with an integration (songpal) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of songpal 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 songpal 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.

@YoshiWalsh YoshiWalsh force-pushed the songpal-select-entities branch from aa12359 to efa45ed Compare June 20, 2025 16:17
@YoshiWalsh YoshiWalsh force-pushed the songpal-select-entities branch from efa45ed to 42b2784 Compare June 20, 2025 18:17
@joostlek joostlek marked this pull request as draft June 20, 2025 18:22
@YoshiWalsh YoshiWalsh force-pushed the songpal-select-entities branch from 42b2784 to be6424f Compare June 20, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants