aioamazondevices 3.3.2__tar.gz → 3.5.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.
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/PKG-INFO +13 -19
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/README.md +12 -18
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/pyproject.toml +1 -1
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/src/aioamazondevices/__init__.py +1 -1
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/src/aioamazondevices/api.py +35 -10
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/LICENSE +0 -0
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/src/aioamazondevices/const.py +0 -0
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/src/aioamazondevices/exceptions.py +0 -0
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/src/aioamazondevices/py.typed +0 -0
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/src/aioamazondevices/sounds.py +0 -0
- {aioamazondevices-3.3.2 → aioamazondevices-3.5.0}/src/aioamazondevices/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: aioamazondevices
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.5.0
|
4
4
|
Summary: Python library to control Amazon devices
|
5
5
|
License: Apache-2.0
|
6
6
|
Author: Simone Chemelli
|
@@ -85,30 +85,17 @@ The script accept command line arguments or a library_test.json config file:
|
|
85
85
|
}
|
86
86
|
```
|
87
87
|
|
88
|
-
##
|
89
|
-
|
90
|
-
Library logs a warning if an unknown device type is linked to your Amazon account.
|
88
|
+
## Known Issues & Limitations
|
91
89
|
|
92
|
-
|
90
|
+
See [wiki](https://github.com/chemelli74/aioamazondevices/wiki/Known-Issues-and-Limitations)
|
93
91
|
|
94
|
-
|
95
|
-
- brand
|
96
|
-
- model
|
97
|
-
- generation
|
98
|
-
- entities are available in Home Assistant
|
99
|
-
- entities work in Home Assistant
|
92
|
+
## Unknown device type
|
100
93
|
|
101
|
-
|
94
|
+
See [wiki](https://github.com/chemelli74/aioamazondevices/wiki/Unknown-Device-Types)
|
102
95
|
|
103
96
|
## Roadmap
|
104
97
|
|
105
|
-
|
106
|
-
|
107
|
-
- Stabilizing library for all countries
|
108
|
-
- Re-introduce sensors via graphQL
|
109
|
-
- Introduce timers/schedules/alarms
|
110
|
-
- Introduce real time websocket updates (media player control)
|
111
|
-
- Introduce control for Bluetooth connected devices
|
98
|
+
See [wiki](https://github.com/chemelli74/aioamazondevices/wiki/Roadmap)
|
112
99
|
|
113
100
|
## Contributors ✨
|
114
101
|
|
@@ -140,6 +127,13 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
140
127
|
<sub><b>jameson_uk</b></sub>
|
141
128
|
</a>
|
142
129
|
</td>
|
130
|
+
<td align="center">
|
131
|
+
<a href="https://github.com/ivanfmartinez">
|
132
|
+
<img src="https://avatars.githubusercontent.com/u/677001?v=4" width="100;" alt="ivanfmartinez"/>
|
133
|
+
<br />
|
134
|
+
<sub><b>Ivan F. Martinez</b></sub>
|
135
|
+
</a>
|
136
|
+
</td>
|
143
137
|
<td align="center">
|
144
138
|
<a href="https://github.com/lchavezcuu">
|
145
139
|
<img src="https://avatars.githubusercontent.com/u/22165856?v=4" width="100;" alt="lchavezcuu"/>
|
@@ -62,30 +62,17 @@ The script accept command line arguments or a library_test.json config file:
|
|
62
62
|
}
|
63
63
|
```
|
64
64
|
|
65
|
-
##
|
66
|
-
|
67
|
-
Library logs a warning if an unknown device type is linked to your Amazon account.
|
65
|
+
## Known Issues & Limitations
|
68
66
|
|
69
|
-
|
67
|
+
See [wiki](https://github.com/chemelli74/aioamazondevices/wiki/Known-Issues-and-Limitations)
|
70
68
|
|
71
|
-
|
72
|
-
- brand
|
73
|
-
- model
|
74
|
-
- generation
|
75
|
-
- entities are available in Home Assistant
|
76
|
-
- entities work in Home Assistant
|
69
|
+
## Unknown device type
|
77
70
|
|
78
|
-
|
71
|
+
See [wiki](https://github.com/chemelli74/aioamazondevices/wiki/Unknown-Device-Types)
|
79
72
|
|
80
73
|
## Roadmap
|
81
74
|
|
82
|
-
|
83
|
-
|
84
|
-
- Stabilizing library for all countries
|
85
|
-
- Re-introduce sensors via graphQL
|
86
|
-
- Introduce timers/schedules/alarms
|
87
|
-
- Introduce real time websocket updates (media player control)
|
88
|
-
- Introduce control for Bluetooth connected devices
|
75
|
+
See [wiki](https://github.com/chemelli74/aioamazondevices/wiki/Roadmap)
|
89
76
|
|
90
77
|
## Contributors ✨
|
91
78
|
|
@@ -117,6 +104,13 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
117
104
|
<sub><b>jameson_uk</b></sub>
|
118
105
|
</a>
|
119
106
|
</td>
|
107
|
+
<td align="center">
|
108
|
+
<a href="https://github.com/ivanfmartinez">
|
109
|
+
<img src="https://avatars.githubusercontent.com/u/677001?v=4" width="100;" alt="ivanfmartinez"/>
|
110
|
+
<br />
|
111
|
+
<sub><b>Ivan F. Martinez</b></sub>
|
112
|
+
</a>
|
113
|
+
</td>
|
120
114
|
<td align="center">
|
121
115
|
<a href="https://github.com/lchavezcuu">
|
122
116
|
<img src="https://avatars.githubusercontent.com/u/22165856?v=4" width="100;" alt="lchavezcuu"/>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"""Support for Amazon devices."""
|
2
2
|
|
3
|
+
import asyncio
|
3
4
|
import base64
|
4
5
|
import hashlib
|
5
6
|
import mimetypes
|
@@ -369,15 +370,39 @@ class AmazonEchoApi:
|
|
369
370
|
self._load_website_cookies() if self._login_stored_data else self._cookies
|
370
371
|
)
|
371
372
|
self.session.cookie_jar.update_cookies(_cookies)
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
373
|
+
|
374
|
+
resp: ClientResponse | None = None
|
375
|
+
for delay in [0, 1, 2, 5, 8, 12, 21]:
|
376
|
+
if delay:
|
377
|
+
_LOGGER.info(
|
378
|
+
"Sleeping for %s seconds before retrying API call to %s", delay, url
|
379
|
+
)
|
380
|
+
await asyncio.sleep(delay)
|
381
|
+
|
382
|
+
try:
|
383
|
+
resp = await self.session.request(
|
384
|
+
method,
|
385
|
+
URL(url, encoded=True),
|
386
|
+
data=input_data if not json_data else orjson.dumps(input_data),
|
387
|
+
headers=headers,
|
388
|
+
)
|
389
|
+
|
390
|
+
except (TimeoutError, ClientConnectorError) as exc:
|
391
|
+
_LOGGER.warning("Connection error to %s: %s", url, repr(exc))
|
392
|
+
raise CannotConnect(f"Connection error during {method}") from exc
|
393
|
+
|
394
|
+
# Retry with a delay only for specific HTTP status
|
395
|
+
# that can benefits of a back-off
|
396
|
+
if resp.status not in [
|
397
|
+
HTTPStatus.INTERNAL_SERVER_ERROR,
|
398
|
+
HTTPStatus.SERVICE_UNAVAILABLE,
|
399
|
+
HTTPStatus.TOO_MANY_REQUESTS,
|
400
|
+
]:
|
401
|
+
break
|
402
|
+
|
403
|
+
if resp is None:
|
404
|
+
_LOGGER.error("No response received from %s", url)
|
405
|
+
raise CannotConnect(f"No response received from {url}")
|
381
406
|
|
382
407
|
if not self._csrf_cookie:
|
383
408
|
self._csrf_cookie = resp.cookies.get(CSRF_COOKIE, Morsel()).value
|
@@ -902,7 +927,7 @@ class AmazonEchoApi:
|
|
902
927
|
)
|
903
928
|
if not model_details:
|
904
929
|
_LOGGER.warning(
|
905
|
-
"Unknown device type '%s' for %s: please read https://github.com/chemelli74/aioamazondevices
|
930
|
+
"Unknown device type '%s' for %s: please read https://github.com/chemelli74/aioamazondevices/wiki/Unknown-Device-Types",
|
906
931
|
device.device_type,
|
907
932
|
device.account_name,
|
908
933
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|