Skip to content

Commit

Permalink
Merge branch 'master' into zc_cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Jul 25, 2023
2 parents 42c337a + 18edbf4 commit 46fb418
Show file tree
Hide file tree
Showing 24 changed files with 494 additions and 213 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ A client library for Apple TV and AirPlay devices
[![codecov](https://codecov.io/gh/postlund/pyatv/branch/master/graph/badge.svg)](https://codecov.io/gh/postlund/pyatv)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![PyPi Package](https://badge.fury.io/py/pyatv.svg)](https://badge.fury.io/py/pyatv)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/postlund/pyatv.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/postlund/pyatv/context:python)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/postlund/pyatv)
[![Downloads](https://pepy.tech/badge/pyatv)](https://pepy.tech/project/pyatv)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/pyatv.svg)](https://pypi.python.org/pypi/pyatv/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

This is an asyncio python library for interacting with Apple TV and AirPlay devices. It mainly
targets Apple TVs (all generations, **including tvOS 15**), but also support audio streaming via AirPlay to
receivers like the HomePod, AirPort Express and third-party speakers. It can act as remote control to the Music
targets Apple TVs (all generations, **including tvOS 15 and later**), but also supports audio streaming via AirPlay
to receivers like the HomePod, AirPort Express and third-party speakers. It can act as remote control to the Music
app/iTunes in macOS.

All the documentation you need is available at **[pyatv.dev](https://pyatv.dev)**.
Expand All @@ -29,6 +28,9 @@ Some examples include:
* Metadata retrieval with push updates
* Stream files via AirPlay
* List and launch installed apps
* List and switch user accounts
* Add, remove or set audio output devices (e.g. HomePods)
* Keyboard support

...and lots more! A complete list is available [here](https://pyatv.dev/documentation/supported_features/).

Expand Down
2 changes: 1 addition & 1 deletion chickn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ variables:
- pyatv
- scripts
- examples
cs_exclude_words: cann,cant,asai,cafs
cs_exclude_words: infoms,cann,cant,asai,cafs
requirements_file: requirements/requirements.txt
miniaudio_package: $(grep miniaudio= requirements/requirements.txt)

Expand Down
62 changes: 39 additions & 23 deletions docs/api/pyatv/exceptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ <h4><code><a title="pyatv.exceptions.CommandError" href="#pyatv.exceptions.Comma
<h4><code><a title="pyatv.exceptions.ConnectionFailedError" href="#pyatv.exceptions.ConnectionFailedError">ConnectionFailedError</a></code></h4>
</li>
<li>
<h4><code><a title="pyatv.exceptions.ConnectionLostError" href="#pyatv.exceptions.ConnectionLostError">ConnectionLostError</a></code></h4>
</li>
<li>
<h4><code><a title="pyatv.exceptions.DeviceIdMissingError" href="#pyatv.exceptions.DeviceIdMissingError">DeviceIdMissingError</a></code></h4>
</li>
<li>
Expand Down Expand Up @@ -102,7 +105,7 @@ <h1 class="title">Module <code>pyatv.exceptions</code></h1>
</header>
<section id="section-intro">
<p>Local exceptions used by library.</p>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L1-L123" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L1-L127" class="git-link">Browse git</a></div>
</section>
<section>
</section>
Expand All @@ -119,7 +122,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
</code></dt>
<dd>
<section class="desc"><p>Thrown when authentication fails.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L23-L24" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L27-L28" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -132,7 +135,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when device mandates a backoff period.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L59-L60" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L63-L64" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -148,7 +151,7 @@ <h3>Ancestors</h3>
<p>Typically, public interface methods (e.g. any method available via the object
returned by <code><a title="pyatv.connect" href="index#pyatv.connect">connect()</a></code>) becomes blocked after either calling close or because
the connection was closed for some other reason.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L109-L115" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L113-L119" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -161,7 +164,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when a command (e.g. play or pause) failed.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L67-L68" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L71-L72" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -181,13 +184,26 @@ <h3>Ancestors</h3>
<li>builtins.BaseException</li>
</ul>
</dd>
<dt id="pyatv.exceptions.ConnectionLostError"><code class="flex name class">
<span>class <span class="ident">ConnectionLostError</span></span>
<span>(</span><span>*args, **kwargs)</span>
</code></dt>
<dd>
<section class="desc"><p>Thrown when a connection is lost.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L19-L20" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
<li>builtins.BaseException</li>
</ul>
</dd>
<dt id="pyatv.exceptions.DeviceIdMissingError"><code class="flex name class">
<span>class <span class="ident">DeviceIdMissingError</span></span>
<span>(</span><span>*args, **kwargs)</span>
</code></dt>
<dd>
<section class="desc"><p>Thrown when device id is missing.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L55-L56" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L59-L60" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -201,7 +217,7 @@ <h3>Ancestors</h3>
<dd>
<section class="desc"><p>Thrown when a HTTP error occurs.</p>
<p>Initialize a new HttpError.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L91-L102" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L95-L106" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li><a title="pyatv.exceptions.ProtocolError" href="#pyatv.exceptions.ProtocolError">ProtocolError</a></li>
Expand All @@ -213,7 +229,7 @@ <h3>Instance variables</h3>
<dt id="pyatv.exceptions.HttpError.status_code"><code class="name">var <span class="ident">status_code</span> -> int</code></dt>
<dd>
<section class="desc"><p>Return status code that triggered the error.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L99-L102" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L103-L106" class="git-link">Browse git</a></div>
</dd>
</dl>
</dd>
Expand All @@ -223,7 +239,7 @@ <h3>Instance variables</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when something is wrong or missing in the config.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L105-L106" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L109-L110" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -236,7 +252,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown if credentials are invalid.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L51-L52" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L55-L56" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -249,7 +265,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when invalid DMAP data is parsed.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L31-L32" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L35-L36" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -262,7 +278,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when a remote sends an invalid response.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L118-L119" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L122-L123" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -275,7 +291,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when trying to perform an action not possible in the current state.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L78-L79" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L82-L83" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -288,7 +304,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when starting AsyncUpdater with no listener.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L43-L44" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L47-L48" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -301,7 +317,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown if credentials are missing.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L47-L48" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L51-L52" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -328,7 +344,7 @@ <h3>Ancestors</h3>
<dd>
<section class="desc"><p>Thrown when address it not in any local subnet.</p>
<p>DEPRECATED: Not used since 0.7.1. Will be removed in 0.9.0!</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L71-L75" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L75-L79" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -341,7 +357,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when trying to perform an action that is not supported.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L27-L28" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L31-L32" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.NotImplementedError</li>
Expand All @@ -356,7 +372,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Raised when a timeout happens.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L122-L123" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L126-L127" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -369,7 +385,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when pairing fails.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L19-L20" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L23-L24" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -382,7 +398,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when media playback failed.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L63-L64" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L67-L68" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -398,7 +414,7 @@ <h3>Ancestors</h3>
<p>Generic protocol errors includes for instance missing fields, incorrect or
unexpected types, etc. Any error that can happen when communicating with a device
that is not covered by another exception is covered by this exception.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L82-L88" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L86-L92" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -415,7 +431,7 @@ <h3>Subclasses</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when an unknown media kind is found.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L35-L36" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L39-L40" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand All @@ -428,7 +444,7 @@ <h3>Ancestors</h3>
</code></dt>
<dd>
<section class="desc"><p>Thrown when an unknown play state is found.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L39-L40" class="git-link">Browse git</a></div>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/exceptions.py#L43-L44" class="git-link">Browse git</a></div>
<h3>Ancestors</h3>
<ul class="hlist">
<li>builtins.Exception</li>
Expand Down
3 changes: 2 additions & 1 deletion docs/api/pyatv/interface.html
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,7 @@ <h3>Methods</h3>
<h3>Subclasses</h3>
<ul class="hlist">
<li>pyatv.core.facade.FacadeRemoteControl</li>
<li>pyatv.protocols.airplay.AirPlayRemoteControl</li>
<li>pyatv.protocols.companion.CompanionRemoteControl</li>
<li>pyatv.protocols.dmap.DmapRemoteControl</li>
<li>pyatv.protocols.mrp.MrpRemoteControl</li>
Expand Down Expand Up @@ -1997,7 +1998,7 @@ <h3>Methods</h3>
<dd>
<div class="api_feature">
<span>Feature: <a title="pyatv.const.FeatureName.Stop" href="const#pyatv.const.FeatureName.Stop">FeatureName.Stop</a>,</span>
<span>Supported by: <a title="pyatv.const.Protocol.DMAP" href="const#pyatv.const.Protocol.DMAP">Protocol.DMAP</a>, <a title="pyatv.const.Protocol.MRP" href="const#pyatv.const.Protocol.MRP">Protocol.MRP</a>, <a title="pyatv.const.Protocol.RAOP" href="const#pyatv.const.Protocol.RAOP">Protocol.RAOP</a></span>
<span>Supported by: <a title="pyatv.const.Protocol.AirPlay" href="const#pyatv.const.Protocol.AirPlay">Protocol.AirPlay</a>, <a title="pyatv.const.Protocol.DMAP" href="const#pyatv.const.Protocol.DMAP">Protocol.DMAP</a>, <a title="pyatv.const.Protocol.MRP" href="const#pyatv.const.Protocol.MRP">Protocol.MRP</a>, <a title="pyatv.const.Protocol.RAOP" href="const#pyatv.const.Protocol.RAOP">Protocol.RAOP</a></span>
</div>
<section class="desc"><p>Press key stop.</p></section>
<div class="git-link-div"><a href="https://github.com/postlund/pyatv/blob/master/pyatv/interface.py#L314-L317" class="git-link">Browse git</a></div>
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/atvremote.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Unsupported: Not supported by this device (or by pyatv)

## Apps

Show active app:
Show app currently playing something:

```shell
$ atvremote --id 00:11:22:33:44:54 app
Expand Down
4 changes: 4 additions & 0 deletions pyatv/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class ConnectionFailedError(Exception):
"""Thrown when connection fails, e.g. refused or timed out."""


class ConnectionLostError(Exception):
"""Thrown when a connection is lost."""


class PairingError(Exception):
"""Thrown when pairing fails."""

Expand Down
Loading

0 comments on commit 46fb418

Please sign in to comment.