aioamazondevices 3.2.7__py3-none-any.whl → 3.2.8__py3-none-any.whl
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/__init__.py +1 -1
- aioamazondevices/api.py +21 -1
- {aioamazondevices-3.2.7.dist-info → aioamazondevices-3.2.8.dist-info}/METADATA +1 -1
- {aioamazondevices-3.2.7.dist-info → aioamazondevices-3.2.8.dist-info}/RECORD +6 -6
- {aioamazondevices-3.2.7.dist-info → aioamazondevices-3.2.8.dist-info}/LICENSE +0 -0
- {aioamazondevices-3.2.7.dist-info → aioamazondevices-3.2.8.dist-info}/WHEEL +0 -0
aioamazondevices/__init__.py
CHANGED
aioamazondevices/api.py
CHANGED
@@ -339,6 +339,14 @@ class AmazonEchoApi:
|
|
339
339
|
)
|
340
340
|
return False
|
341
341
|
|
342
|
+
async def _ignore_phoenix_error(self, response: ClientResponse) -> bool:
|
343
|
+
"""Return true if error is due to phoenix endpoint."""
|
344
|
+
# Endpoint URI_IDS replies with error 199 or 299
|
345
|
+
# during maintenance
|
346
|
+
return response.status in [HTTP_ERROR_199, HTTP_ERROR_299] and (
|
347
|
+
URI_IDS in response.url.path
|
348
|
+
)
|
349
|
+
|
342
350
|
async def _http_phrase_error(self, error: int) -> str:
|
343
351
|
"""Convert numeric error in human phrase."""
|
344
352
|
if error == HTTP_ERROR_199:
|
@@ -415,7 +423,9 @@ class AmazonEchoApi:
|
|
415
423
|
HTTPStatus.UNAUTHORIZED,
|
416
424
|
]:
|
417
425
|
raise CannotAuthenticate(await self._http_phrase_error(resp.status))
|
418
|
-
if not await self._ignore_ap_signin_error(
|
426
|
+
if not await self._ignore_ap_signin_error(
|
427
|
+
resp
|
428
|
+
) and not await self._ignore_phoenix_error(resp):
|
419
429
|
raise CannotRetrieveData(
|
420
430
|
f"Request failed: {await self._http_phrase_error(resp.status)}"
|
421
431
|
)
|
@@ -596,6 +606,16 @@ class AmazonEchoApi:
|
|
596
606
|
url=f"https://alexa.amazon.{self._domain}{URI_IDS}",
|
597
607
|
amazon_user_agent=False,
|
598
608
|
)
|
609
|
+
|
610
|
+
# Sensors data not available
|
611
|
+
if raw_resp.status != HTTPStatus.OK:
|
612
|
+
_LOGGER.warning(
|
613
|
+
"Sensors data not available [%s error '%s'], skipping",
|
614
|
+
URI_IDS,
|
615
|
+
await self._http_phrase_error(raw_resp.status),
|
616
|
+
)
|
617
|
+
return []
|
618
|
+
|
599
619
|
json_data = await raw_resp.json()
|
600
620
|
|
601
621
|
network_detail = orjson.loads(json_data["networkDetail"])
|
@@ -1,11 +1,11 @@
|
|
1
|
-
aioamazondevices/__init__.py,sha256=
|
2
|
-
aioamazondevices/api.py,sha256=
|
1
|
+
aioamazondevices/__init__.py,sha256=W7DER8aV-e-yKCMzNIRzrK4atTh5CSbPVGmumiVNPlc,276
|
2
|
+
aioamazondevices/api.py,sha256=jDXVTwR4yA-yPskCqpmeT9CCN-EGuHQqQmjVwcU9L1o,40399
|
3
3
|
aioamazondevices/const.py,sha256=mgPTTRLLets0vU8MTvVA3pGWGHCgVLMBRZWsIVtCG8s,9043
|
4
4
|
aioamazondevices/exceptions.py,sha256=CfOFKDvE_yl5BFoFcpTOuDfgRi_2oAtKk-nNJgfWBAs,726
|
5
5
|
aioamazondevices/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
aioamazondevices/sounds.py,sha256=01pVCDFIuhrLypXInw4JNuHsC6zjMLsuKocet1R6we8,13409
|
7
7
|
aioamazondevices/utils.py,sha256=RzuKRhnq_8ymCoJMoQJ2vBYyuew06RSWpqQWmqdNczE,2019
|
8
|
-
aioamazondevices-3.2.
|
9
|
-
aioamazondevices-3.2.
|
10
|
-
aioamazondevices-3.2.
|
11
|
-
aioamazondevices-3.2.
|
8
|
+
aioamazondevices-3.2.8.dist-info/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
|
9
|
+
aioamazondevices-3.2.8.dist-info/METADATA,sha256=nsCTEGVeOr37isIHVQgDCUrV72xuUMn7wtFLwc3WhlY,5234
|
10
|
+
aioamazondevices-3.2.8.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
11
|
+
aioamazondevices-3.2.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|