-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Add Bang & Olufsen media_player grouping #123020
Add Bang & Olufsen media_player grouping #123020
Conversation
Add support for media player grouping via beolink Give media player entity name
Revert naming changes
simplify Beolink attributes
Add unexpand return value Set entity name on initialization
Add all_discovered to beolink_expand service Improve beolink_expand response
Update response typing for updated API
Remove mypy ignore line Fix jid possibly used before assignment
Fix formatting
Fix remote leader media position bug Improve remote leader BangOlufsenSource comparison
…m/mj23000/core into bang_olufsen_add_beolink_grouping
Rework _get_beolink_jid
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Clarify invalid entity error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a couple of minor remarks on the tests.
assert mock_mozart_client.join_latest_beolink_experience.call_count == 0 | ||
|
||
|
||
async def test_async_unjoin_player( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a negative case to assert what happens when trying to unjoin a player which is not in a group?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unjoin service simply calls post_beolink_leave
regardless if the device is in a group or not, which leaves the session or does nothing, so I don't think there is anything left to test here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @mj23000 👍
* Add Beolink custom services Add support for media player grouping via beolink Give media player entity name * Fix progress not being set to None as Beolink listener Revert naming changes * Update API simplify Beolink attributes * Improve beolink custom services * Fix Beolink expandable source check Add unexpand return value Set entity name on initialization * Handle entity naming as intended * Fix "null" Beolink self friendly name * Add regex service input validation Add all_discovered to beolink_expand service Improve beolink_expand response * Add service icons * Fix merge Remove unnecessary assignment * Remove invalid typing Update response typing for updated API * Revert to old typed response dict method Remove mypy ignore line Fix jid possibly used before assignment * Re add debugging logging * Fix coroutine Fix formatting * Remove unnecessary update control * Make tests pass Fix remote leader media position bug Improve remote leader BangOlufsenSource comparison * Fix naming and add callback decorators * Move regex service check to variable Suppress KeyError Update tests * Re-add hass running check * Improve comments, naming and type hinting * Remove old temporary fix * Convert logged warning to raised exception for invalid media_player Simplify code using walrus operator * Fix test for invalid media_player grouping * Improve method naming * Improve _beolink_sources explanation * Improve _beolink_sources explanation * Add initial media_player grouping * Convert custom service methods to media_player methods Fix testing * Remove beolink JID extra state attribute * Modify custom services to only work as expected for media_player grouping Fix tests * Remove unused dispatch * Remove wrong comment * Remove commented out code * Add config entry mock typing * Fix beolink listener playback progress Fix formatting Add and use get_serial_number_from_jid function * Fix testing * Clarify beolink WebSocket notifications * Further clarify beolink WebSocket notifications * Convert notification value to enum value * Improve comments for touch to join * Fix None being cast to str if leader is not in HA * Add error messages to devices in Beolink session and not Home Assistant Rework _get_beolink_jid * Replace redundant function call * Show friendly name for unavailable remote leader instead of JID * Update homeassistant/components/bang_olufsen/media_player.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Remove unneeded typing * Rework _get_beolink_jid entity check Clarify invalid entity error message * Remove redundant "entity" from string * Fix invalid typing fix state assertions * Fix raised error type --------- Co-authored-by: Erik Montnemery <erik@montnemery.com>
Proposed change
Add media_player grouping to the Bang & Olufsen media_player entity. This implementation does not contain any custom services, but does still have some structure from the previous (too big) PR: #113438.
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: