So, what's new? Yeah, right, tvOS 15 was released the day before yesterday
which broke everything. My intention was to release 0.9.0 before tvOS 15
dropped, but things kept popping up and I had no choice but to delay. So here
we are.
The biggest feature in this release is obviously support for tvOS 15. Perhaps
not the most exciting feature per se, but important as most of the
functionality in pyatv is lost without it. The gist is that Apple decided to
drop support for the MRP protocol introduced in tvOS. In practice they didn't
get rid or it, they just allocated a special stream type in AirPlay (2) and
decided to tunnel MRP over it. So MRP is still there, it's just carried over
AirPlay now. As far as I know, this is how they have done it the last couple of
iOS/tvOS releases. So it's not really new, just something no one looked into.
The deprecation of the "regular" MRP protocol is reasonable (who uses the
Remote app nowadays?), so I don't blame Apple for it. Would have been nice to
have figured this out earlier though, as it required a lot of intense reverse
engineering to unravel everything. Now it does work though, so totally worth
it! I have tried to document how it works on the protocols page:
https://pyatv.dev/documentation/protocols/
All needed to get things working again is to provide AirPlay credentials. One
important thing to note though is that you need to re-pair with this release
(or later) to get new credentials. The old ones will only work with `play_url`,
not for tunneling MRP over AirPlay. A small bonus here is that the HomePod
works in the same way as the Apple TV in this regards, so pyatv can now be used
to control HomdPods as well. No pairing is needed for that, it's just
plug-and-play!
Let's leave MRP now... My vision for pyatv is to create a "core", where
protocols work as plugins to provide functionality. The API used by developers
is supposed be towards core and not the protocols themselves. This basically
means that all functions in the API should behave in the same way, no matter
what protocols are used in regards to arguments, return values, listener
interfaces, error handling and so on. This release contains a lof of work
towards realizing that vision. I'm not quite there yet, but it's closer than
ever. Hopefully, this will only manifest itself through more consistent
behavior and not much you as a developer need to pay any attention to. But if
you notice any changes in behavior, this might be the reason. Be sure to report
anything that you find peculiar, it might need fixing or an explanation.
Another minor new feature is that the Audio interface has been extended to
include volume_up and volume_down, which also means those methods are
deprecated in `RemoteControl`. Please update your code for this. Also, all the
protocol specic service types, e.g. `conf.MrpService` and `conf.AirPlayService`
have been deprecated in favor of `conf.ManualService`. Update your code for
this as well, in case you rely on any of them. They will stick around for a few
releases, so your code won't break because of this. The last minor feature is a
helper method called `helpers.is_streamable`, which can check if file is
supported by `Stream.stream_file`.
One last thing... This release fills a big gap that has been present for a long
time: when do you need to pair? Each service now contains a "pairing" property
that will tell you of pairing is needed or not. This makes it possible to
programmatically determine if the pairing procedure needs to to performed,
something that wasn't clear before. After scanning, just iterate all services
and pair the ones requiring it. A similar property has been added for passwords
as well, called `requires_password`. If True, then a password is required to
connect. Only applicable to RAOP so far (it works for AirPlay as well, but
there's no support for passwords in AirPlay yet).
To round things up, I just wanted to say that docker images are automatically
built for new releases as well as the latest commit on master, making it easy
to test pyatv without having to install any additional software other than
docker. I still have some areas to improve, but it's a good start. This release
will be the first release having docker images pre-built as it's tricky to
backport.
That is it for now. Make sure to check out the migration guide to get some
hints on what you need to do when upgrading.
Be sure to check out the migration notes before upgrading:
https://pyatv.dev/support/migration/
**Notes:**
* mediafile replaced audio-metadata as a dependency in this release
* At least version 3.17.3 of protobuf is required
**Changes:**
*Protocol: DMAP:*
099c975 dmap: Add support for pairing requirement
*Protocol: MRP:*
6177e86 mrp: Add support for pairing requirement
0bdd614 mrp: Add support for Audio interface
2495e56 mrp: Extract build number from DEVICE_INFO
*Protocol: AirPlay:*
31bf148 airplay: Add support for pairing requirement
af5c441 airplay: Add support for requires_password
8c35d1f airplay: Add support for transient pairing
a407efa airplay: Support MRP tunneling over AirPlay 2
*Protocol: Companion:*
e49b9ef companion: Add support for pairing requirement
*Protocol: RAOP:*
d47924d raop: Send empty audio during latency period
f075d4d raop: Add support for pairing requirement
f66563a raop: Add support for requires_password
*Other:*
9339954 if: Add volume_up and volume_down to Audio
1c11600 gh: Convert issue templates to forms
8f7f9bd gha: Build and publish Docker containers
4f76bf3 core: Switch from audio-metadata to mediafile