aioamazondevices 3.2.1__py3-none-any.whl → 3.2.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__ = "3.2.1"
3
+ __version__ = "3.2.2"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
aioamazondevices/api.py CHANGED
@@ -352,7 +352,7 @@ class AmazonEchoApi:
352
352
  if not amazon_user_agent:
353
353
  _LOGGER.debug("Changing User-Agent to %s", DEFAULT_AGENT)
354
354
  headers.update({"User-Agent": DEFAULT_AGENT})
355
- if self._csrf_cookie and CSRF_COOKIE not in headers:
355
+ if self._csrf_cookie:
356
356
  csrf = {CSRF_COOKIE: self._csrf_cookie}
357
357
  _LOGGER.debug("Adding <%s> to headers", csrf)
358
358
  headers.update(csrf)
@@ -377,6 +377,9 @@ class AmazonEchoApi:
377
377
  raise CannotConnect(f"Connection error during {method}") from exc
378
378
 
379
379
  self._cookies.update(**await self._parse_cookies_from_headers(resp.headers))
380
+ if not self._csrf_cookie:
381
+ self._csrf_cookie = resp.cookies.get(CSRF_COOKIE, Morsel()).value
382
+ _LOGGER.debug("CSRF cookie value: <%s>", self._csrf_cookie)
380
383
 
381
384
  content_type: str = resp.headers.get("Content-Type", "")
382
385
  _LOGGER.debug(
@@ -786,11 +789,6 @@ class AmazonEchoApi:
786
789
  _LOGGER.debug("Response code: |%s|", response_code)
787
790
 
788
791
  response_data = await raw_resp.text()
789
-
790
- if not self._csrf_cookie:
791
- self._csrf_cookie = raw_resp.cookies.get(CSRF_COOKIE, Morsel()).value
792
- _LOGGER.debug("CSRF cookie value: <%s>", self._csrf_cookie)
793
-
794
792
  json_data = {} if len(response_data) == 0 else await raw_resp.json()
795
793
 
796
794
  _LOGGER.debug("JSON data: |%s|", scrub_fields(json_data))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aioamazondevices
3
- Version: 3.2.1
3
+ Version: 3.2.2
4
4
  Summary: Python library to control Amazon devices
5
5
  License: Apache-2.0
6
6
  Author: Simone Chemelli
@@ -1,11 +1,11 @@
1
- aioamazondevices/__init__.py,sha256=ylzOup7JB2cQ19iiOzvj0UaBpJlY2v4hV0fxxJyVeqo,276
2
- aioamazondevices/api.py,sha256=8wXIou_9WeFjbNS4_qPbQ8YFWUfN8EdIbivQ-UWSGDI,39218
1
+ aioamazondevices/__init__.py,sha256=qelvi3_OmLOGJDAwlKAmQe5biPKQ8p0sbMx3c2Tpif0,276
2
+ aioamazondevices/api.py,sha256=yIU0w95V9v7fDlArNK26azOtogBX8yxJJKBJbA_UWKs,39169
3
3
  aioamazondevices/const.py,sha256=q2TlD1O4jPtQ-hIxCCZuD-uoXCFNudF11JSjSC2hClY,8687
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.1.dist-info/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
9
- aioamazondevices-3.2.1.dist-info/METADATA,sha256=qS7EZlIpIOa1F0BMNwW0Z3iAI_g5vFlXv3WSitr7NqI,5234
10
- aioamazondevices-3.2.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
11
- aioamazondevices-3.2.1.dist-info/RECORD,,
8
+ aioamazondevices-3.2.2.dist-info/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
9
+ aioamazondevices-3.2.2.dist-info/METADATA,sha256=JIkelm9RwNWUra00wyvNp_wR09BNskKA-NFF013cbHU,5234
10
+ aioamazondevices-3.2.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
11
+ aioamazondevices-3.2.2.dist-info/RECORD,,