aioamazondevices 1.4.0__tar.gz → 1.4.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.
- {aioamazondevices-1.4.0 → aioamazondevices-1.4.2}/PKG-INFO +1 -1
- {aioamazondevices-1.4.0 → aioamazondevices-1.4.2}/pyproject.toml +1 -1
- {aioamazondevices-1.4.0 → aioamazondevices-1.4.2}/src/aioamazondevices/__init__.py +1 -1
- {aioamazondevices-1.4.0 → aioamazondevices-1.4.2}/src/aioamazondevices/api.py +6 -7
- {aioamazondevices-1.4.0 → aioamazondevices-1.4.2}/src/aioamazondevices/const.py +2 -0
- {aioamazondevices-1.4.0 → aioamazondevices-1.4.2}/LICENSE +0 -0
- {aioamazondevices-1.4.0 → aioamazondevices-1.4.2}/README.md +0 -0
- {aioamazondevices-1.4.0 → aioamazondevices-1.4.2}/src/aioamazondevices/exceptions.py +0 -0
- {aioamazondevices-1.4.0 → aioamazondevices-1.4.2}/src/aioamazondevices/py.typed +0 -0
@@ -8,7 +8,6 @@ import uuid
|
|
8
8
|
from dataclasses import dataclass
|
9
9
|
from datetime import UTC, datetime, timedelta
|
10
10
|
from http import HTTPStatus
|
11
|
-
from http.cookies import SimpleCookie
|
12
11
|
from pathlib import Path
|
13
12
|
from typing import Any, cast
|
14
13
|
from urllib.parse import parse_qs, urlencode
|
@@ -99,12 +98,12 @@ class AmazonEchoApi:
|
|
99
98
|
|
100
99
|
self.session: ClientSession
|
101
100
|
|
102
|
-
def _load_website_cookies(self) ->
|
101
|
+
def _load_website_cookies(self) -> dict[str, str]:
|
103
102
|
"""Get website cookies, if avaliables."""
|
104
103
|
if not self._login_stored_data:
|
105
|
-
return
|
104
|
+
return {}
|
106
105
|
|
107
|
-
return cast("
|
106
|
+
return cast("dict", self._login_stored_data["website_cookies"])
|
108
107
|
|
109
108
|
def _serial_number(self) -> str:
|
110
109
|
"""Get or calculate device serial number."""
|
@@ -312,7 +311,7 @@ class AmazonEchoApi:
|
|
312
311
|
|
313
312
|
_LOGGER.warning("Saving data to %s", fullpath)
|
314
313
|
|
315
|
-
with Path.open(fullpath, "w
|
314
|
+
with Path.open(fullpath, mode="w", encoding="utf-8") as file:
|
316
315
|
file.write(data)
|
317
316
|
file.write("\n")
|
318
317
|
|
@@ -363,7 +362,7 @@ class AmazonEchoApi:
|
|
363
362
|
input_data=body,
|
364
363
|
json_data=True,
|
365
364
|
)
|
366
|
-
resp_json = resp.json()
|
365
|
+
resp_json = await resp.json()
|
367
366
|
|
368
367
|
if resp.status != HTTPStatus.OK:
|
369
368
|
_LOGGER.error(
|
@@ -374,7 +373,7 @@ class AmazonEchoApi:
|
|
374
373
|
raise CannotRegisterDevice(resp_json)
|
375
374
|
|
376
375
|
await self._save_to_file(
|
377
|
-
resp.text,
|
376
|
+
await resp.text(),
|
378
377
|
url=register_url,
|
379
378
|
extension=JSON_EXTENSION,
|
380
379
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|