Closed postlund closed 1 year ago
Patch coverage: 97.28%
and project coverage change: +0.23%
:tada:
Comparison is base (
05ca46d
) 88.72% compared to head (4c4800b
) 88.96%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
It's finally time to introduce something I've been working on for a while: storage! The storage API provides means for pyatv to store things like credentials and passwords so you don't have to type them manually all the time. As a start, pyatv includes a file based storage module that stores everything in a JSON structured file. The API is however flexible, so you can write your own storage (quite simple) that stores it somewhere else, like a file in Google Drive. I have also adjusted
atvremote
andatvscript
to use file storage by default, so everything will be stored in$HOME/.pyatv.conf
now.All devices found during scanning will be stored automatically. Also, credentials obtained via pairing will be inserted into the storage automatically. So once you have paired once, you don't have to care about credentials again, i.e. no need specifying
--xxx-credentials
anymore. Same goes if you specify--xxx-password
. Pretty neat actually.Another benefit of this is that setting can be stored as well. I have added a few fields that allows setting things like custom remote name, MAC address, OS version and so on.
These are currently not used, but I will address that too soon.Other things that I will include are ways to specify static port numbers where randomized ports are used today. Also a way to force AirPlay 1 when connecting to an AirPlay 2 receiver as well.I have also made some improvements to the API reference, so that value of enums are now printed as well:
And lastly... I have started working on a "wizard" in
atvremote
that simplifies setting up a new device. You simply runatvremote wizard
and follow the instructions:Since file storage is used, the credentials will be automatically saved. So once the wizard is done, you don't have to care about pairing, credentials or password anymore. You will even get some hints if incorrect access mode is not configured. This is still very early, so expect things to change and improve over time. But I hope everyone will like this!
I am still not finished with the work here, I have some details to iron out. Mostly it's related to documentation and testing, since a lot of things are missing tests. But it would be really great to get some feedback on the work so far, so please give it a spin and let me know how it works!One additional last thing... I have added commands to
atvremote
to simplify working with settings. So they can be listed like this for instance:Or even changed:
I believe most things are done now, but I do need to split and clean up my changes in a few commits. So I should be ready to merge this very soon!