aioamazondevices 1.4.0__py3-none-any.whl → 1.4.2__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.
@@ -1,6 +1,6 @@
1
1
  """aioamazondevices library."""
2
2
 
3
- __version__ = "1.4.0"
3
+ __version__ = "1.4.2"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
aioamazondevices/api.py CHANGED
@@ -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) -> list[SimpleCookie]:
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("list", self._login_stored_data["website_cookies"])
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+") as file:
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
  )
aioamazondevices/const.py CHANGED
@@ -74,4 +74,6 @@ DEVICE_TYPE_TO_MODEL = {
74
74
  "A3S5BH2HU6VAYF": "Echo Dot (Gen2)",
75
75
  "A4ZXE0RM7LQ7A": "Echo Dot (Gen5)",
76
76
  "AKNO1N0KSFN8L": "Echo Dot (Gen1)",
77
+ "A3C9PE6TNYLTCH": "Speaker Group",
78
+ "A1Q6UGEXJZWJQ0": "Fire TV Stick 4K",
77
79
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aioamazondevices
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: Python library to control Amazon devices
5
5
  License: Apache-2.0
6
6
  Author: Simone Chemelli
@@ -0,0 +1,9 @@
1
+ aioamazondevices/__init__.py,sha256=ULqm0lLKzKpyTykBdp4LYqsHO1IdYJs3HOqvqPwQYK0,276
2
+ aioamazondevices/api.py,sha256=glXaplcf1ertJKdMGGnJXaWoc-KO2YjPyEp3Loa5ju0,23528
3
+ aioamazondevices/const.py,sha256=6BBEg_q2BkYVYJcz3hMrLNyEwOJBWziPSStMzftWQLg,2106
4
+ aioamazondevices/exceptions.py,sha256=qK_Hak9pc-lC2FPW-0i4rYIwNpEOHMmA9Rii8F2lkQo,1260
5
+ aioamazondevices/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ aioamazondevices-1.4.2.dist-info/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
7
+ aioamazondevices-1.4.2.dist-info/METADATA,sha256=arhG3K_PxvduCQ2Wwta7bIBGDoIjVl4ZC8URslGS2Vc,4964
8
+ aioamazondevices-1.4.2.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
9
+ aioamazondevices-1.4.2.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- aioamazondevices/__init__.py,sha256=ILY9TIfzVJ37uVhDYsOdxQt-UZ6aHO_gsrl6bCMtHQ8,276
2
- aioamazondevices/api.py,sha256=v7_sG005v2sKoeF247fuHrW-BQekv3xviHsURpVxQP4,23534
3
- aioamazondevices/const.py,sha256=vQzdTM1UBhS3g1jQ5BH_Jr1o1BUx6yym4DZ86nmNCR4,2025
4
- aioamazondevices/exceptions.py,sha256=qK_Hak9pc-lC2FPW-0i4rYIwNpEOHMmA9Rii8F2lkQo,1260
5
- aioamazondevices/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- aioamazondevices-1.4.0.dist-info/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
7
- aioamazondevices-1.4.0.dist-info/METADATA,sha256=1VEgtlZkdYS1JCQUg3tlSDU2aQWyelxgop0r-t0jjjo,4964
8
- aioamazondevices-1.4.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
9
- aioamazondevices-1.4.0.dist-info/RECORD,,