aioamazondevices 3.1.2__tar.gz → 3.1.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aioamazondevices
3
- Version: 3.1.2
3
+ Version: 3.1.4
4
4
  Summary: Python library to control Amazon devices
5
5
  License: Apache-2.0
6
6
  Author: Simone Chemelli
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "aioamazondevices"
3
- version = "3.1.2"
3
+ version = "3.1.4"
4
4
  description = "Python library to control Amazon devices"
5
5
  authors = ["Simone Chemelli <simone.chemelli@gmail.com>"]
6
6
  license = "Apache-2.0"
@@ -1,6 +1,6 @@
1
1
  """aioamazondevices library."""
2
2
 
3
- __version__ = "3.1.2"
3
+ __version__ = "3.1.4"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
@@ -352,8 +352,8 @@ class AmazonEchoApi:
352
352
  HTTPStatus.UNAUTHORIZED,
353
353
  ]:
354
354
  raise CannotAuthenticate
355
- if not self._ignore_ap_sigin_error(resp):
356
- raise RequestFailed
355
+ if not await self._ignore_ap_sigin_error(resp):
356
+ raise RequestFailed("Request failed with HTTP error %s", resp.status)
357
357
 
358
358
  await self._save_to_file(
359
359
  await resp.text(),
@@ -538,7 +538,9 @@ class AmazonEchoApi:
538
538
  serial_number = device_identifier["dmsDeviceSerialNumber"]
539
539
 
540
540
  # Add identifier information to the device
541
- self._devices[serial_number] |= {NODE_IDENTIFIER: identifier}
541
+ # but only if the device was previously found
542
+ if serial_number in self._devices:
543
+ self._devices[serial_number] |= {NODE_IDENTIFIER: identifier}
542
544
 
543
545
  # Add to entity IDs list for sensor retrieval
544
546
  entity_ids_list.append({"entityId": entity_id, "entityType": "ENTITY"})