aioamazondevices 0.12.0__tar.gz → 0.13.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-0.12.0 → aioamazondevices-0.13.0}/PKG-INFO +1 -1
- {aioamazondevices-0.12.0 → aioamazondevices-0.13.0}/pyproject.toml +1 -1
- {aioamazondevices-0.12.0 → aioamazondevices-0.13.0}/src/aioamazondevices/__init__.py +1 -1
- {aioamazondevices-0.12.0 → aioamazondevices-0.13.0}/src/aioamazondevices/api.py +2 -15
- {aioamazondevices-0.12.0 → aioamazondevices-0.13.0}/LICENSE +0 -0
- {aioamazondevices-0.12.0 → aioamazondevices-0.13.0}/README.md +0 -0
- {aioamazondevices-0.12.0 → aioamazondevices-0.13.0}/src/aioamazondevices/auth.py +0 -0
- {aioamazondevices-0.12.0 → aioamazondevices-0.13.0}/src/aioamazondevices/const.py +0 -0
- {aioamazondevices-0.12.0 → aioamazondevices-0.13.0}/src/aioamazondevices/exceptions.py +0 -0
- {aioamazondevices-0.12.0 → aioamazondevices-0.13.0}/src/aioamazondevices/py.typed +0 -0
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
import base64
|
4
4
|
import hashlib
|
5
|
-
import json
|
6
5
|
import mimetypes
|
7
6
|
import secrets
|
8
7
|
import uuid
|
@@ -66,7 +65,7 @@ class AmazonEchoApi:
|
|
66
65
|
login_country_code: str,
|
67
66
|
login_email: str,
|
68
67
|
login_password: str,
|
69
|
-
|
68
|
+
login_data: dict[str, Any] | None = None,
|
70
69
|
save_raw_data: bool = False,
|
71
70
|
) -> None:
|
72
71
|
"""Initialize the scanner."""
|
@@ -89,24 +88,12 @@ class AmazonEchoApi:
|
|
89
88
|
self._cookies = self._build_init_cookies()
|
90
89
|
self._headers = DEFAULT_HEADERS
|
91
90
|
self._save_raw_data = save_raw_data
|
92
|
-
self._login_stored_data
|
91
|
+
self._login_stored_data = login_data
|
93
92
|
self._serial = self._serial_number()
|
94
93
|
self._website_cookies: dict[str, Any] = self._load_website_cookies()
|
95
94
|
|
96
95
|
self.session: AsyncClient
|
97
96
|
|
98
|
-
def _load_data_file(self, data_file: str | None) -> dict[str, Any]:
|
99
|
-
"""Load stored login data from file."""
|
100
|
-
if not data_file or not (file := Path(data_file)).exists():
|
101
|
-
_LOGGER.debug(
|
102
|
-
"Cannot find previous login data file <%s>",
|
103
|
-
data_file,
|
104
|
-
)
|
105
|
-
return {}
|
106
|
-
|
107
|
-
with Path.open(file, "rb") as f:
|
108
|
-
return cast(dict[str, Any], json.load(f))
|
109
|
-
|
110
97
|
def _load_website_cookies(self) -> dict[str, Any]:
|
111
98
|
"""Get website cookies, if avaliables."""
|
112
99
|
if not self._login_stored_data:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|