Finally time for a new release and this (despite the few number
of commits) is a big one: this release introduces the storage API!
in reality, the storage API comes with two distinct features:
* Storing and loading of credentials and passwords
* Support for generic settings
The first one is pretty obvious and also the biggest one here.
From now on, pyatv will automatically save credentials to a file
when pairing and automatically load them again without the need
of manually specifying them (the same applies to passwords as
well). This is true for built in scripts like `atvremote` and
`atvscript`. You need to add a few lines of code to support it
within your applications.
The API is generic in the sense that you can implement your own
storage if you like. Perhaps you want to store your credentials in
Dropbox or a Google Document? That is possible by writing a custom
storage module. This release ships with a `FileStorage` module
that stores settings in a local file using JSON as storage format.
There's also a `MemoryStorage` module that just keeps settings in
memory. The latter one is used by default if no storage is provided
as a means of backwards compatibility.
Moving on to generic settings then. Ways to alter the behavior of
pyatv has been requested in several ways throughout the years. Be
it specifying port nunbers or changing the way a protocol behaves.
There has not been any way of implementing such settings until now.
Biggest reason for it was because I wanted to implement storage
first to see how things would fit together. I guess the benefit is
that we now got both features at once.
As a start, only a few metadata fields like MAC address and
operating system version can be changed. I will add more settings
over time and you can request additional settings by opening
issues. As new settings adds extra maintenance burden (e.g. more
tests), I will be a bit picky though.
I have fixed a small detail in the documentation as well. The
value of members in enums are now shown. Only the name was shown
before. The same change also applies to the pydantic models used
for settings, so you can see default values for all settings
directly in the API reference.
Oh, and one more thing... A wizard moved in to `atvremote`. If
you run `atvremote wizard`, he will find all your devices, let you
pick one and help out with setting it up (guiding you through
pairing and passwords). Once you have completed the wizard, all
credentials are saved to storage and you don't have to think about
that anymore. Pretty neat, huh? This is still an early version,
so expect bugs and please report them so they can be fixed.
That is is. A pretty good release to be honest. Time for some
rest!
**Changes:**
*Other:*
d13ede5 docs: Another attempt to fix docs
7498250 docs: Try to fix API docs for some modules
856fede storage: Switch to pyfakefs for testing