Pyatv: Support for "companion" protocol

Created on 14 May 2020  路  7Comments  路  Source: postlund/pyatv

What feature would you like?
As it turns out, there can never be too many protocols. Apparently there's a protocol called "companion link", announced as the zeroconf service _companion-link._tcp.local.. I'm not entirely sure what all the use cases for it are, but I do know that this is the protocol used by the Apple TV widget in action center since iOS 13 (prior to that MRP was used) and it is also used to launch apps from Shortcuts. I'm especially interested in the latter in order to implement #303. I suspect that this protocol is used by Handoff and Continuity as well.

Describe the solution you'd like
Preferably I would like a generic implementation of the protocol next to the other ones and use that to implement #303. Perhaps there are other interesting features this can be used for as well (e.g. fetch list of installed apps).

Any other information to share?
Not much is written about this protocol from what I have gathered. So this is quite uncharted territories and will probably need a lot of work. I have started hacking on an implementation outside of pyatv as a test. It doesn't work yet, it's just a start and my intention is to lift this work in to pyatv and start working on support for pairing. I'm gonna share as much as possible publicly in case someone wants to help reverse engineering this protocol.

I will need some time to prepare a PR.

feature help wanted

Most helpful comment

The focus on pyatv and the Apple TV component is kinda low right now, doing some other things. It got a bit too much for long a long time (and I'm on parental leave with two kids, so not much time), so I need to focus on something else for a while to find the spark again. Current status is that I have a few outstanding issues, e.g. connection hangs after a while and MDNS discovery does not work properly. Assuming I can fix that so that feature development can start again, the companion protocol will be the first thing I will get working on. It's by far the most interesting feature and will be the main thing in the 0.8 roadmap. So I'm sorry to be the bearer of some bad news here, but I promise that this is the first thing I will start working on once I get going on pyatv again. Shouldn't be that long into the future. I currently work on improvements in the localtuya custom component. Once I'm done there I will get back on this horse.

All 7 comments

I will likely push something tonight or tomorrow as I have successfully integrated my work so far into pyatv. Working on some documentation now.

Took some additional time but is now available in #657. Enjoy!

I think the encryption part is more or less complete. In the sense of knowing how it works. Finalizing the implementation will take a lot more time.

Next I will continue with support in atvproxy so I can intercept traffic. It's gonna be great!

Super excited for what this could enable.

Yeah, I am too! At least launching apps and getting the list of installed apps, but maybe more. It will be fun to explore!

Sorry to bug but just wanting to see if there鈥檚 been any progress on this.

Just want to know how much to prioritize some of the automation I was going to build around this.

Thanks!

The focus on pyatv and the Apple TV component is kinda low right now, doing some other things. It got a bit too much for long a long time (and I'm on parental leave with two kids, so not much time), so I need to focus on something else for a while to find the spark again. Current status is that I have a few outstanding issues, e.g. connection hangs after a while and MDNS discovery does not work properly. Assuming I can fix that so that feature development can start again, the companion protocol will be the first thing I will get working on. It's by far the most interesting feature and will be the main thing in the 0.8 roadmap. So I'm sorry to be the bearer of some bad news here, but I promise that this is the first thing I will start working on once I get going on pyatv again. Shouldn't be that long into the future. I currently work on improvements in the localtuya custom component. Once I'm done there I will get back on this horse.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nriley picture nriley  路  18Comments

Krocko picture Krocko  路  10Comments

rephlex00 picture rephlex00  路  8Comments

lorenzoCuevas picture lorenzoCuevas  路  10Comments

oviano picture oviano  路  14Comments