pyatv-http 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyatv_http-0.1.2/.renovaterc.json +4 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/PKG-INFO +5 -5
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/README.md +2 -2
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/mise.toml +4 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/pyproject.toml +18 -18
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/src/pyatv_http/config.py +3 -2
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/tests/test_config.py +19 -1
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/uv.lock +20 -20
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/.github/workflows/hk.yml +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/.github/workflows/release.yml +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/.gitignore +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/.yamllint +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/LICENSE +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/biome.json +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/hk.pkl +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/src/pyatv_http/__init__.py +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/src/pyatv_http/app.py +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/src/pyatv_http/atv.py +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/src/pyatv_http/auth.py +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/src/pyatv_http/cli.py +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/src/pyatv_http/gen_config.py +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/tests/test_app.py +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/tests/test_atv.py +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/tests/test_cli.py +0 -0
- {pyatv_http-0.1.0 → pyatv_http-0.1.2}/tests/test_gen_config.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyatv-http
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: HTTP interface for controlling Apple TVs via pyatv
|
|
5
5
|
Project-URL: Homepage, https://github.com/hugoh/pyatv-http
|
|
6
|
-
Project-URL: Repository, https://github.com/hugoh/pyatv-http
|
|
7
6
|
Project-URL: Issues, https://github.com/hugoh/pyatv-http/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/hugoh/pyatv-http
|
|
8
8
|
Author: Hugo Haas
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: LICENSE
|
|
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
18
18
|
Classifier: Topic :: Home Automation
|
|
19
19
|
Requires-Python: >=3.12
|
|
20
20
|
Requires-Dist: fastapi>=0.121.0
|
|
21
|
-
Requires-Dist: pyatv>=0.
|
|
21
|
+
Requires-Dist: pyatv>=0.18.0
|
|
22
22
|
Requires-Dist: uvicorn>=0.38.0
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
|
|
@@ -106,7 +106,7 @@ identifier = "11:22:33:44:55:66"
|
|
|
106
106
|
credentials = "..."
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
- `port` — port the HTTP server listens on.
|
|
109
|
+
- `port` — port the HTTP server listens on. Optional, defaults to `8080`.
|
|
110
110
|
- `[auth].tokens` — required, non-empty list of bearer tokens accepted on every
|
|
111
111
|
request (see [API](#api) below). Generate one with e.g.
|
|
112
112
|
`python3 -c "import secrets; print(secrets.token_urlsafe(32))"`.
|
|
@@ -196,6 +196,6 @@ These three routes are not themselves behind the bearer-token check.
|
|
|
196
196
|
|
|
197
197
|
```sh
|
|
198
198
|
uv sync
|
|
199
|
-
uv run pytest
|
|
199
|
+
uv run pytest # or: mise run test
|
|
200
200
|
hk check --all
|
|
201
201
|
```
|
|
@@ -82,7 +82,7 @@ identifier = "11:22:33:44:55:66"
|
|
|
82
82
|
credentials = "..."
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
- `port` — port the HTTP server listens on.
|
|
85
|
+
- `port` — port the HTTP server listens on. Optional, defaults to `8080`.
|
|
86
86
|
- `[auth].tokens` — required, non-empty list of bearer tokens accepted on every
|
|
87
87
|
request (see [API](#api) below). Generate one with e.g.
|
|
88
88
|
`python3 -c "import secrets; print(secrets.token_urlsafe(32))"`.
|
|
@@ -172,6 +172,6 @@ These three routes are not themselves behind the bearer-token check.
|
|
|
172
172
|
|
|
173
173
|
```sh
|
|
174
174
|
uv sync
|
|
175
|
-
uv run pytest
|
|
175
|
+
uv run pytest # or: mise run test
|
|
176
176
|
hk check --all
|
|
177
177
|
```
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyatv-http"
|
|
3
|
-
dynamic = ["version"]
|
|
4
3
|
description = "HTTP interface for controlling Apple TVs via pyatv"
|
|
5
|
-
authors = [
|
|
6
|
-
{ name = "Hugo Haas" },
|
|
7
|
-
]
|
|
8
4
|
readme = "README.md"
|
|
5
|
+
requires-python = ">=3.12"
|
|
9
6
|
license = "MIT"
|
|
10
7
|
license-files = ["LICENSE"]
|
|
11
|
-
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Hugo Haas" },
|
|
10
|
+
]
|
|
12
11
|
classifiers = [
|
|
13
12
|
"Development Status :: 3 - Alpha",
|
|
14
13
|
"Environment :: Console",
|
|
@@ -19,47 +18,48 @@ classifiers = [
|
|
|
19
18
|
"Programming Language :: Python :: 3.12",
|
|
20
19
|
"Topic :: Home Automation",
|
|
21
20
|
]
|
|
21
|
+
dynamic = ["version"]
|
|
22
22
|
|
|
23
23
|
dependencies = [
|
|
24
|
-
"pyatv>=0.16.0",
|
|
25
24
|
"fastapi>=0.121.0",
|
|
25
|
+
"pyatv>=0.18.0",
|
|
26
26
|
"uvicorn>=0.38.0",
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
[project.urls]
|
|
30
30
|
Homepage = "https://github.com/hugoh/pyatv-http"
|
|
31
|
-
Repository = "https://github.com/hugoh/pyatv-http"
|
|
32
31
|
Issues = "https://github.com/hugoh/pyatv-http/issues"
|
|
32
|
+
Repository = "https://github.com/hugoh/pyatv-http"
|
|
33
33
|
|
|
34
34
|
[project.scripts]
|
|
35
35
|
pyatv-http = "pyatv_http.cli:main"
|
|
36
36
|
|
|
37
|
-
[build-system]
|
|
38
|
-
requires = ["hatchling", "hatch-vcs"]
|
|
39
|
-
build-backend = "hatchling.build"
|
|
40
|
-
|
|
41
37
|
[dependency-groups]
|
|
42
38
|
dev = [
|
|
43
|
-
"
|
|
44
|
-
"ruff>=0.15.20",
|
|
39
|
+
"httpx>=0.28.1",
|
|
45
40
|
"pytest>=9.1.1",
|
|
46
41
|
"pytest-asyncio>=1.3.0",
|
|
47
|
-
"
|
|
42
|
+
"ruff>=0.15.20",
|
|
43
|
+
"ty>=0.0.57",
|
|
48
44
|
]
|
|
49
45
|
|
|
46
|
+
[build-system]
|
|
47
|
+
requires = ["hatch-vcs", "hatchling"]
|
|
48
|
+
build-backend = "hatchling.build"
|
|
49
|
+
|
|
50
50
|
[tool.hatch.build.targets.wheel]
|
|
51
51
|
packages = ["src/pyatv_http"]
|
|
52
52
|
|
|
53
53
|
[tool.hatch.version]
|
|
54
54
|
source = "vcs"
|
|
55
55
|
|
|
56
|
+
[tool.pytest.ini_options]
|
|
57
|
+
testpaths = ["tests"]
|
|
58
|
+
asyncio_mode = "auto"
|
|
59
|
+
|
|
56
60
|
[tool.ruff]
|
|
57
61
|
line-length = 88
|
|
58
62
|
target-version = "py312"
|
|
59
63
|
|
|
60
64
|
[tool.ruff.lint]
|
|
61
65
|
select = ["E", "F", "I", "B", "UP", "SIM"]
|
|
62
|
-
|
|
63
|
-
[tool.pytest.ini_options]
|
|
64
|
-
testpaths = ["tests"]
|
|
65
|
-
asyncio_mode = "auto"
|
|
@@ -5,6 +5,7 @@ from dataclasses import dataclass, field
|
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
|
|
7
7
|
KNOWN_PROTOCOLS = frozenset({"airplay", "companion", "dmap", "mrp", "raop"})
|
|
8
|
+
DEFAULT_PORT = 8080
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class ConfigError(Exception):
|
|
@@ -97,9 +98,9 @@ def load_config(path: str | Path) -> AppConfig:
|
|
|
97
98
|
|
|
98
99
|
data = tomllib.loads(path.read_text())
|
|
99
100
|
|
|
100
|
-
port = data.get("port")
|
|
101
|
+
port = data.get("port", DEFAULT_PORT)
|
|
101
102
|
if not isinstance(port, int):
|
|
102
|
-
raise ConfigError("
|
|
103
|
+
raise ConfigError("invalid field 'port': must be an integer")
|
|
103
104
|
|
|
104
105
|
raw_devices = data.get("devices")
|
|
105
106
|
if not raw_devices:
|
|
@@ -75,7 +75,7 @@ def test_unknown_device_key_returns_none(tmp_path):
|
|
|
75
75
|
assert config.get_device("bedroom") is None
|
|
76
76
|
|
|
77
77
|
|
|
78
|
-
def
|
|
78
|
+
def test_missing_port_defaults_to_8080(tmp_path):
|
|
79
79
|
path = tmp_path / "config.toml"
|
|
80
80
|
path.write_text(
|
|
81
81
|
AUTH_BLOCK
|
|
@@ -87,6 +87,24 @@ address = "10.0.0.5"
|
|
|
87
87
|
"""
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
+
config = load_config(path)
|
|
91
|
+
|
|
92
|
+
assert config.port == 8080
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def test_invalid_port_raises(tmp_path):
|
|
96
|
+
path = tmp_path / "config.toml"
|
|
97
|
+
path.write_text(
|
|
98
|
+
'port = "not-a-number"\n'
|
|
99
|
+
+ AUTH_BLOCK
|
|
100
|
+
+ """
|
|
101
|
+
[devices.living_room]
|
|
102
|
+
name = "Living Room"
|
|
103
|
+
identifier = "AA:BB:CC:DD:EE:FF"
|
|
104
|
+
address = "10.0.0.5"
|
|
105
|
+
"""
|
|
106
|
+
)
|
|
107
|
+
|
|
90
108
|
with pytest.raises(ConfigError, match="port"):
|
|
91
109
|
load_config(path)
|
|
92
110
|
|
|
@@ -870,7 +870,7 @@ dev = [
|
|
|
870
870
|
[package.metadata]
|
|
871
871
|
requires-dist = [
|
|
872
872
|
{ name = "fastapi", specifier = ">=0.121.0" },
|
|
873
|
-
{ name = "pyatv", specifier = ">=0.
|
|
873
|
+
{ name = "pyatv", specifier = ">=0.18.0" },
|
|
874
874
|
{ name = "uvicorn", specifier = ">=0.38.0" },
|
|
875
875
|
]
|
|
876
876
|
|
|
@@ -1114,27 +1114,27 @@ wheels = [
|
|
|
1114
1114
|
|
|
1115
1115
|
[[package]]
|
|
1116
1116
|
name = "ty"
|
|
1117
|
-
version = "0.0.
|
|
1117
|
+
version = "0.0.62"
|
|
1118
1118
|
source = { registry = "https://pypi.org/simple" }
|
|
1119
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1119
|
+
sdist = { url = "https://files.pythonhosted.org/packages/ff/2c/ecf9d6a7456e64ea9114d21e68edaea77ecda9151cc89dfd3ed0b673e4a9/ty-0.0.62.tar.gz", hash = "sha256:145b6feba4d5f38b6d595eb41f7a8ec1c970a0a83b79a70680e9e3b787a3e381", size = 6271717, upload-time = "2026-07-22T01:02:43.732Z" }
|
|
1120
1120
|
wheels = [
|
|
1121
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1122
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1123
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1124
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1125
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1126
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1127
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1128
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1129
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1130
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1131
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1132
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1133
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1134
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1135
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1136
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1137
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1121
|
+
{ url = "https://files.pythonhosted.org/packages/e4/ab/cb629d65b4437b298214a095488a8d84ec349f225ed84da13763adfce08b/ty-0.0.62-py3-none-linux_armv6l.whl", hash = "sha256:3db167f0aef29e7c34d47414c9ce160fd045e9b2d6a0edd08d0331b4eaa3b9ad", size = 12045218, upload-time = "2026-07-22T01:02:04.497Z" },
|
|
1122
|
+
{ url = "https://files.pythonhosted.org/packages/b7/c9/f6555aa3b0c46bf2a38891a2048c45616e836a6aab96dff847ab01cc83b3/ty-0.0.62-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:aab3f1d6ca4c9ad1869e57164478694d9828ad1dfcadc192ece7215a20859197", size = 11688585, upload-time = "2026-07-22T01:02:06.795Z" },
|
|
1123
|
+
{ url = "https://files.pythonhosted.org/packages/56/25/9f4a322c64ac8a4f2d1593749bb5932c5c964e557fe7788116fa029b2463/ty-0.0.62-py3-none-macosx_11_0_arm64.whl", hash = "sha256:69ce10b241f487b69ccdc36ca4ac4f4ba683172d24594b5d7296a66f7e26d15c", size = 11204179, upload-time = "2026-07-22T01:02:09.109Z" },
|
|
1124
|
+
{ url = "https://files.pythonhosted.org/packages/ef/db/d9cf7d5343ff896c2d780caec3dcd0ee77493d8a4140b8aa49e15824abff/ty-0.0.62-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fd736420acb009d00a2379e47be4085dd3e3cdbe5305bdf5acce0dd9082f1bbb", size = 11745874, upload-time = "2026-07-22T01:02:11.507Z" },
|
|
1125
|
+
{ url = "https://files.pythonhosted.org/packages/4b/23/a575008c2ccdaacaf1c358be52087db449ea73a78c91c8afb30084d64cfc/ty-0.0.62-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bca9a80e2e5fb72e88e31cf662aae3bd8d7e9e0005ab517a89c368267c992387", size = 11875688, upload-time = "2026-07-22T01:02:14.072Z" },
|
|
1126
|
+
{ url = "https://files.pythonhosted.org/packages/df/92/43a6250b52a704169b6d864665f286f71588d95ff645941cc0e4ca026ab7/ty-0.0.62-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9f8d2a35940bbdea1d28c36c83d3eaba08bf47990486a066b9cb3ae4fbb8625e", size = 12484062, upload-time = "2026-07-22T01:02:16.081Z" },
|
|
1127
|
+
{ url = "https://files.pythonhosted.org/packages/92/34/35c698baa067a2543a32cd7237ad9bdc63dec1ce8b5b62b4686b4485fec4/ty-0.0.62-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1f8257481a517f05e0621ef3b4ef4089a38ac03f17aa800c9f672df19fd03b3d", size = 13007869, upload-time = "2026-07-22T01:02:18.145Z" },
|
|
1128
|
+
{ url = "https://files.pythonhosted.org/packages/2a/2c/e9dd785d62bcfeb9285cc030495288640f1942bf3228a791a3a30d72f7b4/ty-0.0.62-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0b907322a2cecd3e25902878997d08de57cf0efbb27833f8b3378fbd4f218590", size = 12675651, upload-time = "2026-07-22T01:02:20.299Z" },
|
|
1129
|
+
{ url = "https://files.pythonhosted.org/packages/36/86/5650d8b70bd80946afdb3aaefedd280a698b82d9066f18f8a47f58642230/ty-0.0.62-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac8b70f0b5494feed0a3cf47af579141e4c2e88faffcaeebcb4176e914b54b6a", size = 12324208, upload-time = "2026-07-22T01:02:22.671Z" },
|
|
1130
|
+
{ url = "https://files.pythonhosted.org/packages/38/2d/278a17a0f47a90804a744e7d7a598c47fbc15a357ad5aaff563fee3bc65a/ty-0.0.62-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:059790546f9304a750f28ded9b964a7a27dec88e725d329a4b9ab5d944e83dd6", size = 12616124, upload-time = "2026-07-22T01:02:24.8Z" },
|
|
1131
|
+
{ url = "https://files.pythonhosted.org/packages/1a/51/62741847bd646f8702b9ce61de496804a8ac52055afab8dbb94aaf64f431/ty-0.0.62-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c9e83bc6d59e2b37a1d8923ffb7e2455fd35ad35821a3dc69c8459ca9cd28724", size = 11695150, upload-time = "2026-07-22T01:02:27.17Z" },
|
|
1132
|
+
{ url = "https://files.pythonhosted.org/packages/0c/0d/74bd23f94a527bdc32d8366f51db157f75a3074e320c567a2eae83bd6d21/ty-0.0.62-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f84ac4b606c3b4275a17f7b2f60cb0ca8216972bb7af2f515383ee6e4b1fb7f1", size = 11884562, upload-time = "2026-07-22T01:02:29.09Z" },
|
|
1133
|
+
{ url = "https://files.pythonhosted.org/packages/dd/0e/2f42cc81436b5dc0070b4e353c74cbe94ce91ef5828753db921088dec500/ty-0.0.62-py3-none-musllinux_1_2_i686.whl", hash = "sha256:1c05f8f9cd720fa42744574bf3bda9b1b676f7876e33324b03b21aad81f651df", size = 12071773, upload-time = "2026-07-22T01:02:31.292Z" },
|
|
1134
|
+
{ url = "https://files.pythonhosted.org/packages/42/24/0bd3c0069524bf7d5e610d92dd0698414372015461507280c8787c9cd25b/ty-0.0.62-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:88bef93008228890e990fe9e87f0504b8dea9f9f24534eb3a5ee9d8ab9e5cd4f", size = 12425247, upload-time = "2026-07-22T01:02:34.474Z" },
|
|
1135
|
+
{ url = "https://files.pythonhosted.org/packages/3f/27/08505fa0d2bef8fe4107753bb02ed2da4e323103ff5d423b9cc9eea4346e/ty-0.0.62-py3-none-win32.whl", hash = "sha256:254690c758e9d0ee2c8dfe07320d4e9d54709d5e95fa588ecf5a96391dc8d8d4", size = 11381070, upload-time = "2026-07-22T01:02:36.625Z" },
|
|
1136
|
+
{ url = "https://files.pythonhosted.org/packages/aa/c1/609840f13d1c48e88e5b431fe789650da14cb25da0df2979fe08ce422e73/ty-0.0.62-py3-none-win_amd64.whl", hash = "sha256:d88c2594e6a33c5f859c1d9016ad6137ec304c5d51422ce48894d2b9393956a7", size = 12415015, upload-time = "2026-07-22T01:02:39.193Z" },
|
|
1137
|
+
{ url = "https://files.pythonhosted.org/packages/0f/a8/43f838fa38922f175a223814120b5faeb1bb6e5ef1533e45f543c0f510b8/ty-0.0.62-py3-none-win_arm64.whl", hash = "sha256:11b5e7df21890bef3eda49ae15a0c4d12554917ec4ea90ea985caa33241af627", size = 11773787, upload-time = "2026-07-22T01:02:41.564Z" },
|
|
1138
1138
|
]
|
|
1139
1139
|
|
|
1140
1140
|
[[package]]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|