python-amazon-echo 0.1.1__tar.gz → 0.3.0__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.
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/CHANGELOG.md +38 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/PKG-INFO +72 -6
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/README.md +71 -5
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/pyproject.toml +1 -1
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/src/amazon_echo/__init__.py +5 -1
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/src/amazon_echo/client.py +540 -89
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/src/amazon_echo/const.py +74 -1
- python_amazon_echo-0.3.0/src/amazon_echo/endpoints.py +191 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/src/amazon_echo/models.py +43 -0
- python_amazon_echo-0.3.0/tests/fixtures/graphql_smart_home.json +995 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/test_client.py +33 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/test_models.py +1 -1
- python_amazon_echo-0.3.0/tests/test_smart_home.py +723 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/.gitignore +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/LICENSE +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/src/amazon_echo/__main__.py +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/src/amazon_echo/auth.py +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/src/amazon_echo/exceptions.py +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/src/amazon_echo/local.py +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/src/amazon_echo/push.py +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/src/amazon_echo/py.typed +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/__init__.py +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/conftest.py +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/fixtures/automations.json +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/fixtures/devices.json +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/fixtures/graphql_endpoints.json +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/fixtures/history.json +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/fixtures/notifications.json +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/fixtures/np_player.json +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/test_auth.py +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/test_local.py +0 -0
- {python_amazon_echo-0.1.1 → python_amazon_echo-0.3.0}/tests/test_push.py +0 -0
|
@@ -4,6 +4,44 @@ All notable changes to this project are documented here. The format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
|
|
5
5
|
[Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [0.3.0] - 2026-11-16
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Music alarms: `create_alarm(music=…)` takes an existing music alarm of the
|
|
12
|
+
account and creates a new one with the same station.
|
|
13
|
+
- `play_music(timer=…)`: the music stops after that many seconds.
|
|
14
|
+
|
|
15
|
+
## [0.2.0] - 2026-11-16
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Smart home: `get_smart_home_endpoints()` returns every device linked to the
|
|
20
|
+
account as an `Endpoint` (category, manufacturer, model, the operations it
|
|
21
|
+
accepts and its state: power, brightness, colour, colour temperature,
|
|
22
|
+
temperature, humidity, battery, contact, motion, lock, light shows).
|
|
23
|
+
`get_endpoint_states()` now also reports `illuminance`, `motion`, `humidity`
|
|
24
|
+
and, for the Amazon Air Quality Monitor, `pm25`, `pm10`, `voc`, `co`,
|
|
25
|
+
`air_quality` and `aqm_led`. Both share one GraphQL request when called
|
|
26
|
+
within 5 s. `parse_endpoint_update()` decodes the smart-home push event.
|
|
27
|
+
- Communication preferences per device: `get_communication_preferences`,
|
|
28
|
+
`set_communications`, `set_announcements`, `set_drop_in`.
|
|
29
|
+
- Alexa Guard: `get_guard`, `set_guard` and the `Guard` model.
|
|
30
|
+
- Sequences: `info_skill` (17 "tell me…" skills, see `INFO_SKILLS`),
|
|
31
|
+
`send_sequence` for any node type, `send_mobile_push`,
|
|
32
|
+
`send_drop_in_notification`, and `announce(method="all" | "speak" | "show")`.
|
|
33
|
+
- Alarms: `enable_alarm`, `disable_alarm`, `skip_next_alarm`.
|
|
34
|
+
- Amazon Kids: `get_children`, `get_kids_mode`, `get_kids_profile`,
|
|
35
|
+
`set_kids_mode`.
|
|
36
|
+
- `get_device_preferences` (locale, time zone, temperature scale by device),
|
|
37
|
+
`set_background_image`.
|
|
38
|
+
- `VoiceRecord.person_type`.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- A temperature of -280 (what Amazon reports while a sensor calibrates) is
|
|
43
|
+
returned as None.
|
|
44
|
+
|
|
7
45
|
## [0.1.1] - 2026-11-16
|
|
8
46
|
|
|
9
47
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: python-amazon-echo
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Async Python client for Amazon Echo / Alexa devices: state, settings, media, notifications, lists, HTTP/2 push and LAN discovery
|
|
5
5
|
Project-URL: Homepage, https://github.com/hudsonbrendon/python-amazon-echo
|
|
6
6
|
Project-URL: Repository, https://github.com/hudsonbrendon/python-amazon-echo
|
|
@@ -52,9 +52,22 @@ on the local network. It is not affiliated with Amazon.
|
|
|
52
52
|
volume, default alarm sound, ascending alarm, wake word, AUX direction, whisper
|
|
53
53
|
mode, adaptive volume and any per-device setting key (speaking rate, time zone,
|
|
54
54
|
captions, …).
|
|
55
|
-
- **Actions.** Volume, stop, speak, announce,
|
|
56
|
-
skills, routines,
|
|
57
|
-
|
|
55
|
+
- **Actions.** Volume, stop, speak, announce (spoken, shown or both), text
|
|
56
|
+
command, sounds, music, skills, routines, the "tell me…" info skills (weather,
|
|
57
|
+
traffic, flash briefing, a joke…), any other behavior node type, transport
|
|
58
|
+
commands, Bluetooth, reboot, Echo Show background image.
|
|
59
|
+
- **Notifications to the Alexa app.** A mobile push, or one that opens Drop In.
|
|
60
|
+
- **Communication preferences.** Calls and messages, announcements and Drop In
|
|
61
|
+
per device.
|
|
62
|
+
- **Amazon Kids.** The child profiles of the household, which one a device is
|
|
63
|
+
assigned to, and switching a device into or out of Kids mode.
|
|
64
|
+
- **Alarms, timers and reminders.** List all, create, delete; switch an alarm
|
|
65
|
+
on or off and skip its next ring.
|
|
66
|
+
- **Smart home.** Every device linked to the account (lamps, plugs, sensors,
|
|
67
|
+
locks, Echo Glow, the Air Quality Monitor) with its state and the operations
|
|
68
|
+
it accepts; sensors of the Echos themselves (illuminance, motion, humidity);
|
|
69
|
+
state changes pushed by Amazon decoded into the same values.
|
|
70
|
+
- **Alexa Guard.** Read the panel, arm (away) and disarm (home).
|
|
58
71
|
- **Lists.** Shopping, to-do and custom lists with full item CRUD.
|
|
59
72
|
- **Voice history.**
|
|
60
73
|
- **Push.** One HTTP/2 stream delivers volume, playback, do-not-disturb,
|
|
@@ -121,6 +134,26 @@ await push.start() # background task, reconnects with back-off 5·2ⁿ s (≤ 6
|
|
|
121
134
|
await push.stop()
|
|
122
135
|
```
|
|
123
136
|
|
|
137
|
+
Smart home:
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
for endpoint in await client.get_smart_home_endpoints():
|
|
141
|
+
print(endpoint.name, endpoint.category, endpoint.state)
|
|
142
|
+
|
|
143
|
+
lamp = next(e for e in await client.get_smart_home_endpoints() if e.category == "LIGHT")
|
|
144
|
+
if lamp.supports("brightness", "setBrightness"):
|
|
145
|
+
await client.call_feature(
|
|
146
|
+
lamp.id, "brightness", "setBrightness", payload={"brightness": 40}
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`endpoint.state` uses the keys documented in
|
|
151
|
+
`amazon_echo.endpoints.parse_features` (`power`, `brightness`, `color`,
|
|
152
|
+
`color_temperature`, `temperature`, `humidity`, `battery`, `contact`, `motion`,
|
|
153
|
+
`lock`…); a key is there when the device has the feature, and is None while
|
|
154
|
+
Amazon cannot read it. `get_endpoint_states()` and `get_smart_home_endpoints()`
|
|
155
|
+
share one request when called within 5 seconds.
|
|
156
|
+
|
|
124
157
|
LAN:
|
|
125
158
|
|
|
126
159
|
```python
|
|
@@ -184,8 +217,9 @@ Credentials are read from `~/.config/amazon-echo/credentials.json`
|
|
|
184
217
|
|
|
185
218
|
## Verification
|
|
186
219
|
|
|
187
|
-
How each part was checked against a real amazon.com.br account on 2026-11-15
|
|
188
|
-
|
|
220
|
+
How each part was checked against a real amazon.com.br account on 2026-11-15
|
|
221
|
+
(the 0.2.0 additions on 2026-11-16). Everything is also covered by unit tests
|
|
222
|
+
with mocked HTTP.
|
|
189
223
|
|
|
190
224
|
- **live read** — called against Amazon through this library, answer parsed.
|
|
191
225
|
- **no-op write** — the value just read was written back to one Echo Plus and
|
|
@@ -210,6 +244,8 @@ HTTP.
|
|
|
210
244
|
| `set_volume` (sequence pipeline) | no-op write |
|
|
211
245
|
| `create_reminder`, `delete_notification` | live (a reminder 320 days ahead was created and deleted) |
|
|
212
246
|
| `create_alarm` | ported |
|
|
247
|
+
| `create_alarm(music=…)` (music alarm that reuses the station of an existing one) | ported from Alexa Media Player's request, never sent |
|
|
248
|
+
| `play_music(timer=…)` (stop after that many seconds) | ported from Alexa Media Player's payload, never sent |
|
|
213
249
|
| `create_timer` | ported — body inferred from field names in the app, never sent |
|
|
214
250
|
| `set_wake_word` | ported |
|
|
215
251
|
| `speak`, `announce`, `text_command`, `play_sound`, `play_music`, `launch_skill`, `run_routine`, `stop` | ported |
|
|
@@ -218,6 +254,19 @@ HTTP.
|
|
|
218
254
|
| `add_list_item`, `update_list_item`, `delete_list_item` | ported |
|
|
219
255
|
| `get_voice_history` | live read |
|
|
220
256
|
| `call_feature` | ported |
|
|
257
|
+
| `get_endpoint_states` with the 0.2.0 query (illuminance, motion, humidity, air quality) | live read: a few hundred endpoints, no GraphQL error. Four devices advertise a light sensor and report no value; no device of the account reports motion, humidity or air quality, so those are unit tested only |
|
|
258
|
+
| `get_smart_home_endpoints` | live read; power, brightness, colour, colour temperature, temperature, battery, contact, motion and lock states and the operation names all parsed |
|
|
259
|
+
| `parse_endpoint_update` (smart-home push) | ported, not replayed live — no push stream on the test session |
|
|
260
|
+
| Smart-home operations through `call_feature` (`turnOn`, `turnOff`, `setBrightness`, `setColor`, `setColorTemperature`, `setMode`, `lock`, `unlock`) | ported, not replayed live — they change a device's visible state. The request shapes of `power`, `brightness`, `lock` and `toggle` are the ones in the Alexa app; the payload of `setColorTemperature` is inferred |
|
|
261
|
+
| `get_communication_preferences` | verified live once (an Echo Plus answered `announcements: true, communications: true, drop_in: all`); otherwise the service answered HTTP 503 on about 95 % of 60+ spaced requests on 2026-11-16, on both the `.com` and the marketplace host, with cookies or a bearer token |
|
|
262
|
+
| `set_communications`, `set_announcements`, `set_drop_in` | ported, not replayed live — the no-op write was attempted three times each and the service answered 503 every time |
|
|
263
|
+
| `get_device_preferences`, `get_kids_mode`, `get_children`, `get_kids_profile` | live read |
|
|
264
|
+
| `set_kids_mode` | ported, not replayed live — it changes how a device behaves |
|
|
265
|
+
| `get_guard` | live for an account without Guard (the appliance list is read, no panel is found, None); the state read is ported — the test account has no Guard |
|
|
266
|
+
| `set_guard` | ported, not replayed live — Guard was not touched |
|
|
267
|
+
| `info_skill`, `send_sequence`, `send_mobile_push`, `send_drop_in_notification`, `announce(method=…)` | ported, not replayed live — audible, or visible on a phone |
|
|
268
|
+
| `enable_alarm`, `disable_alarm`, `skip_next_alarm` | ported, not replayed live |
|
|
269
|
+
| `set_background_image` | ported, not replayed live — it changes what an Echo Show displays |
|
|
221
270
|
| `PushClient` | handshake live (HTTP/2, 200, multipart boundary). the stream is then closed within ~1 s because the test session shares its registration with a running `alexa_media` (one stream per registration, see *Known limitations*); event parsing is unit tested only |
|
|
222
271
|
| `probe_local`, `is_reachable` | live (two Echo models answer, a smart TV of another brand returns None) |
|
|
223
272
|
|
|
@@ -242,6 +291,9 @@ HTTP.
|
|
|
242
291
|
pass a naive datetime in the Echo's local time if the host lives elsewhere.
|
|
243
292
|
- **Alarms have no label** in Amazon's API; `create_alarm(label=…)` is accepted
|
|
244
293
|
and ignored.
|
|
294
|
+
- **Music alarms** can only reuse a station: `create_alarm(music=…)` takes a
|
|
295
|
+
music alarm that already exists on the account (create one in the Alexa app
|
|
296
|
+
first) and wakes with the same station. Amazon has no public search for one.
|
|
245
297
|
- **`create_timer` is unverified** (see the table). Use
|
|
246
298
|
`text_command(device, "set a timer for 5 minutes")` if it is rejected.
|
|
247
299
|
- **Voice history** comes 10 records per call; at most 50 are fetched.
|
|
@@ -250,6 +302,20 @@ HTTP.
|
|
|
250
302
|
sends `PUSH_NOTIFICATION_CHANGE`).
|
|
251
303
|
- `devices-v2` no longer reports MAC addresses or battery levels for most
|
|
252
304
|
devices; the MAC comes from GraphQL and is missing for apps and groups.
|
|
305
|
+
- **Communication preferences** come from a service that fails for some
|
|
306
|
+
accounts (HTTP 503 on the test account). The call is not retried and raises
|
|
307
|
+
`AmazonEchoRateLimitError`; treat it as "not available for this device".
|
|
308
|
+
- **Guard** is looked up once per client: an account that gets Guard later is
|
|
309
|
+
noticed by a new client. The free version of Guard was retired by Amazon in
|
|
310
|
+
most countries; the code follows `alexapy` and could not be run.
|
|
311
|
+
- **Smart-home state** is what Amazon last heard from the device's own cloud.
|
|
312
|
+
A value Amazon cannot read is None, and `reachable` is False for a device its
|
|
313
|
+
cloud reports offline.
|
|
314
|
+
- **Locks.** Amazon offers `unlock` only for some locks; check
|
|
315
|
+
`endpoint.supports("lock", "unlock")`.
|
|
316
|
+
- **Deleting voice history is not implemented.** The only endpoint the existing
|
|
317
|
+
clients use for it, `/api/activities`, answers 404 since Amazon moved the
|
|
318
|
+
history to the privacy hub.
|
|
253
319
|
- Amazon can change or remove any of this without notice.
|
|
254
320
|
|
|
255
321
|
## Development
|
|
@@ -28,9 +28,22 @@ on the local network. It is not affiliated with Amazon.
|
|
|
28
28
|
volume, default alarm sound, ascending alarm, wake word, AUX direction, whisper
|
|
29
29
|
mode, adaptive volume and any per-device setting key (speaking rate, time zone,
|
|
30
30
|
captions, …).
|
|
31
|
-
- **Actions.** Volume, stop, speak, announce,
|
|
32
|
-
skills, routines,
|
|
33
|
-
|
|
31
|
+
- **Actions.** Volume, stop, speak, announce (spoken, shown or both), text
|
|
32
|
+
command, sounds, music, skills, routines, the "tell me…" info skills (weather,
|
|
33
|
+
traffic, flash briefing, a joke…), any other behavior node type, transport
|
|
34
|
+
commands, Bluetooth, reboot, Echo Show background image.
|
|
35
|
+
- **Notifications to the Alexa app.** A mobile push, or one that opens Drop In.
|
|
36
|
+
- **Communication preferences.** Calls and messages, announcements and Drop In
|
|
37
|
+
per device.
|
|
38
|
+
- **Amazon Kids.** The child profiles of the household, which one a device is
|
|
39
|
+
assigned to, and switching a device into or out of Kids mode.
|
|
40
|
+
- **Alarms, timers and reminders.** List all, create, delete; switch an alarm
|
|
41
|
+
on or off and skip its next ring.
|
|
42
|
+
- **Smart home.** Every device linked to the account (lamps, plugs, sensors,
|
|
43
|
+
locks, Echo Glow, the Air Quality Monitor) with its state and the operations
|
|
44
|
+
it accepts; sensors of the Echos themselves (illuminance, motion, humidity);
|
|
45
|
+
state changes pushed by Amazon decoded into the same values.
|
|
46
|
+
- **Alexa Guard.** Read the panel, arm (away) and disarm (home).
|
|
34
47
|
- **Lists.** Shopping, to-do and custom lists with full item CRUD.
|
|
35
48
|
- **Voice history.**
|
|
36
49
|
- **Push.** One HTTP/2 stream delivers volume, playback, do-not-disturb,
|
|
@@ -97,6 +110,26 @@ await push.start() # background task, reconnects with back-off 5·2ⁿ s (≤ 6
|
|
|
97
110
|
await push.stop()
|
|
98
111
|
```
|
|
99
112
|
|
|
113
|
+
Smart home:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
for endpoint in await client.get_smart_home_endpoints():
|
|
117
|
+
print(endpoint.name, endpoint.category, endpoint.state)
|
|
118
|
+
|
|
119
|
+
lamp = next(e for e in await client.get_smart_home_endpoints() if e.category == "LIGHT")
|
|
120
|
+
if lamp.supports("brightness", "setBrightness"):
|
|
121
|
+
await client.call_feature(
|
|
122
|
+
lamp.id, "brightness", "setBrightness", payload={"brightness": 40}
|
|
123
|
+
)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
`endpoint.state` uses the keys documented in
|
|
127
|
+
`amazon_echo.endpoints.parse_features` (`power`, `brightness`, `color`,
|
|
128
|
+
`color_temperature`, `temperature`, `humidity`, `battery`, `contact`, `motion`,
|
|
129
|
+
`lock`…); a key is there when the device has the feature, and is None while
|
|
130
|
+
Amazon cannot read it. `get_endpoint_states()` and `get_smart_home_endpoints()`
|
|
131
|
+
share one request when called within 5 seconds.
|
|
132
|
+
|
|
100
133
|
LAN:
|
|
101
134
|
|
|
102
135
|
```python
|
|
@@ -160,8 +193,9 @@ Credentials are read from `~/.config/amazon-echo/credentials.json`
|
|
|
160
193
|
|
|
161
194
|
## Verification
|
|
162
195
|
|
|
163
|
-
How each part was checked against a real amazon.com.br account on 2026-11-15
|
|
164
|
-
|
|
196
|
+
How each part was checked against a real amazon.com.br account on 2026-11-15
|
|
197
|
+
(the 0.2.0 additions on 2026-11-16). Everything is also covered by unit tests
|
|
198
|
+
with mocked HTTP.
|
|
165
199
|
|
|
166
200
|
- **live read** — called against Amazon through this library, answer parsed.
|
|
167
201
|
- **no-op write** — the value just read was written back to one Echo Plus and
|
|
@@ -186,6 +220,8 @@ HTTP.
|
|
|
186
220
|
| `set_volume` (sequence pipeline) | no-op write |
|
|
187
221
|
| `create_reminder`, `delete_notification` | live (a reminder 320 days ahead was created and deleted) |
|
|
188
222
|
| `create_alarm` | ported |
|
|
223
|
+
| `create_alarm(music=…)` (music alarm that reuses the station of an existing one) | ported from Alexa Media Player's request, never sent |
|
|
224
|
+
| `play_music(timer=…)` (stop after that many seconds) | ported from Alexa Media Player's payload, never sent |
|
|
189
225
|
| `create_timer` | ported — body inferred from field names in the app, never sent |
|
|
190
226
|
| `set_wake_word` | ported |
|
|
191
227
|
| `speak`, `announce`, `text_command`, `play_sound`, `play_music`, `launch_skill`, `run_routine`, `stop` | ported |
|
|
@@ -194,6 +230,19 @@ HTTP.
|
|
|
194
230
|
| `add_list_item`, `update_list_item`, `delete_list_item` | ported |
|
|
195
231
|
| `get_voice_history` | live read |
|
|
196
232
|
| `call_feature` | ported |
|
|
233
|
+
| `get_endpoint_states` with the 0.2.0 query (illuminance, motion, humidity, air quality) | live read: a few hundred endpoints, no GraphQL error. Four devices advertise a light sensor and report no value; no device of the account reports motion, humidity or air quality, so those are unit tested only |
|
|
234
|
+
| `get_smart_home_endpoints` | live read; power, brightness, colour, colour temperature, temperature, battery, contact, motion and lock states and the operation names all parsed |
|
|
235
|
+
| `parse_endpoint_update` (smart-home push) | ported, not replayed live — no push stream on the test session |
|
|
236
|
+
| Smart-home operations through `call_feature` (`turnOn`, `turnOff`, `setBrightness`, `setColor`, `setColorTemperature`, `setMode`, `lock`, `unlock`) | ported, not replayed live — they change a device's visible state. The request shapes of `power`, `brightness`, `lock` and `toggle` are the ones in the Alexa app; the payload of `setColorTemperature` is inferred |
|
|
237
|
+
| `get_communication_preferences` | verified live once (an Echo Plus answered `announcements: true, communications: true, drop_in: all`); otherwise the service answered HTTP 503 on about 95 % of 60+ spaced requests on 2026-11-16, on both the `.com` and the marketplace host, with cookies or a bearer token |
|
|
238
|
+
| `set_communications`, `set_announcements`, `set_drop_in` | ported, not replayed live — the no-op write was attempted three times each and the service answered 503 every time |
|
|
239
|
+
| `get_device_preferences`, `get_kids_mode`, `get_children`, `get_kids_profile` | live read |
|
|
240
|
+
| `set_kids_mode` | ported, not replayed live — it changes how a device behaves |
|
|
241
|
+
| `get_guard` | live for an account without Guard (the appliance list is read, no panel is found, None); the state read is ported — the test account has no Guard |
|
|
242
|
+
| `set_guard` | ported, not replayed live — Guard was not touched |
|
|
243
|
+
| `info_skill`, `send_sequence`, `send_mobile_push`, `send_drop_in_notification`, `announce(method=…)` | ported, not replayed live — audible, or visible on a phone |
|
|
244
|
+
| `enable_alarm`, `disable_alarm`, `skip_next_alarm` | ported, not replayed live |
|
|
245
|
+
| `set_background_image` | ported, not replayed live — it changes what an Echo Show displays |
|
|
197
246
|
| `PushClient` | handshake live (HTTP/2, 200, multipart boundary). the stream is then closed within ~1 s because the test session shares its registration with a running `alexa_media` (one stream per registration, see *Known limitations*); event parsing is unit tested only |
|
|
198
247
|
| `probe_local`, `is_reachable` | live (two Echo models answer, a smart TV of another brand returns None) |
|
|
199
248
|
|
|
@@ -218,6 +267,9 @@ HTTP.
|
|
|
218
267
|
pass a naive datetime in the Echo's local time if the host lives elsewhere.
|
|
219
268
|
- **Alarms have no label** in Amazon's API; `create_alarm(label=…)` is accepted
|
|
220
269
|
and ignored.
|
|
270
|
+
- **Music alarms** can only reuse a station: `create_alarm(music=…)` takes a
|
|
271
|
+
music alarm that already exists on the account (create one in the Alexa app
|
|
272
|
+
first) and wakes with the same station. Amazon has no public search for one.
|
|
221
273
|
- **`create_timer` is unverified** (see the table). Use
|
|
222
274
|
`text_command(device, "set a timer for 5 minutes")` if it is rejected.
|
|
223
275
|
- **Voice history** comes 10 records per call; at most 50 are fetched.
|
|
@@ -226,6 +278,20 @@ HTTP.
|
|
|
226
278
|
sends `PUSH_NOTIFICATION_CHANGE`).
|
|
227
279
|
- `devices-v2` no longer reports MAC addresses or battery levels for most
|
|
228
280
|
devices; the MAC comes from GraphQL and is missing for apps and groups.
|
|
281
|
+
- **Communication preferences** come from a service that fails for some
|
|
282
|
+
accounts (HTTP 503 on the test account). The call is not retried and raises
|
|
283
|
+
`AmazonEchoRateLimitError`; treat it as "not available for this device".
|
|
284
|
+
- **Guard** is looked up once per client: an account that gets Guard later is
|
|
285
|
+
noticed by a new client. The free version of Guard was retired by Amazon in
|
|
286
|
+
most countries; the code follows `alexapy` and could not be run.
|
|
287
|
+
- **Smart-home state** is what Amazon last heard from the device's own cloud.
|
|
288
|
+
A value Amazon cannot read is None, and `reachable` is False for a device its
|
|
289
|
+
cloud reports offline.
|
|
290
|
+
- **Locks.** Amazon offers `unlock` only for some locks; check
|
|
291
|
+
`endpoint.supports("lock", "unlock")`.
|
|
292
|
+
- **Deleting voice history is not implemented.** The only endpoint the existing
|
|
293
|
+
clients use for it, `/api/activities`, answers 404 since Amazon moved the
|
|
294
|
+
history to the privacy hub.
|
|
229
295
|
- Amazon can change or remove any of this without notice.
|
|
230
296
|
|
|
231
297
|
## Development
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-amazon-echo"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
8
|
description = "Async Python client for Amazon Echo / Alexa devices: state, settings, media, notifications, lists, HTTP/2 push and LAN discovery"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -20,6 +20,8 @@ from .models import (
|
|
|
20
20
|
BluetoothDevice,
|
|
21
21
|
Device,
|
|
22
22
|
EchoList,
|
|
23
|
+
Endpoint,
|
|
24
|
+
Guard,
|
|
23
25
|
ListItem,
|
|
24
26
|
MediaState,
|
|
25
27
|
Notification,
|
|
@@ -28,7 +30,7 @@ from .models import (
|
|
|
28
30
|
)
|
|
29
31
|
from .push import PushClient, PushEvent
|
|
30
32
|
|
|
31
|
-
__version__ = "0.
|
|
33
|
+
__version__ = "0.3.0"
|
|
32
34
|
|
|
33
35
|
__all__ = [
|
|
34
36
|
"Account",
|
|
@@ -46,6 +48,8 @@ __all__ = [
|
|
|
46
48
|
"Credentials",
|
|
47
49
|
"Device",
|
|
48
50
|
"EchoList",
|
|
51
|
+
"Endpoint",
|
|
52
|
+
"Guard",
|
|
49
53
|
"ListItem",
|
|
50
54
|
"LocalInfo",
|
|
51
55
|
"MediaState",
|