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
Added support for CasaTunes Multiroom Audio #22536
Conversation
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.
This is off to a great start!
- Add a
__init__.py
in the folder with just single line doc string. - Run
script/gen_requirements_all.py
to update the requirements files (this will pickup the lib after you add init). - Update
.coveragerc
since there are no tests.
General question: What is the relationship between player and zone? Is it 1:1? They both seem to be half of a player. I'm wondering if a zone and player should be represented as a single entity...
|
||
async def async_media_seek(self, position): | ||
"""Send seek command.""" | ||
await self._player.seek(position) |
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.
Does this trigger an update so media position reflects the correct placement?
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.
Unfortunately no, but I think I found a workaround. Still need to do a bit of testing.
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.
Given this integration uses polling, you could:
- Update state here if the new data would be available in fresh poll:
self.async_schedule_update_ha_state(True)
.True
indicates to callasync_update
before updating the state machine. - Operate optimistically by setting the new position and last update and then call
self.async_schedule_update_ha_state()
You may need something similar in the other commands if you're finding the state isn't updating until the next poll.
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.
Thanks for the hint! I think, I'll have to spend a bit more time with it as the implementation of CasaTunes "seeking" is not very reliable.
Thanks! I'll try to fix it. No, Zones are basically "Rooms" and players are sources which can be selected to play in those zones. They are both media players with different capabilities: Zones can select the source (player), adjust volume and be muted. Players can pause/play/back/forward and display album art as well as track position (if this is not the radio). I hope that the attached screenshot would make a bit more sense. |
It looks like the build status never reported for this. Can you please rebase and force push? There has also been some architectural changes recently and you will need to update to use the manifest file. |
Are you still working on this? If not, can we close the PR? |
I'm going to close this PR. Feel free to open a new one and tag me if you want to continue with this contribution! |
Description:
This component adds support for CasaTunes multiroom audio servers. Zones are added as media players which can select source, volume and be muted. Sources are added as media players that feed audio to the zones and can support play/pause/stop/backward/forward commands as well as album cover and track position.
Example entry for
configuration.yaml
:Checklist:
tox
.If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTS
.