aioamazondevices 3.1.1__tar.gz → 3.1.3__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.1
3
+ Version: 3.1.3
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.1"
3
+ version = "3.1.3"
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.1"
3
+ __version__ = "3.1.3"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
@@ -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"})
@@ -709,6 +711,7 @@ class AmazonEchoApi:
709
711
  identifier_node = device.get(NODE_IDENTIFIER, {})
710
712
 
711
713
  # Add sensors
714
+ sensors = {}
712
715
  if identifier_node:
713
716
  for _device_id, _device_sensors in devices_sensors.items():
714
717
  if _device_id == identifier_node["entityId"]: