aioamazondevices 6.2.7__tar.gz → 6.2.8__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.

Potentially problematic release.


This version of aioamazondevices might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aioamazondevices
3
- Version: 6.2.7
3
+ Version: 6.2.8
4
4
  Summary: Python library to control Amazon devices
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "aioamazondevices"
3
- version = "6.2.7"
3
+ version = "6.2.8"
4
4
  requires-python = ">=3.12"
5
5
  description = "Python library to control Amazon devices"
6
6
  authors = [
@@ -1,6 +1,6 @@
1
1
  """aioamazondevices library."""
2
2
 
3
- __version__ = "6.2.7"
3
+ __version__ = "6.2.8"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
@@ -602,7 +602,19 @@ class AmazonEchoApi:
602
602
  devices_sensors: dict[str, dict[str, AmazonDeviceSensor]] = {}
603
603
  devices_endpoints: dict[str, dict[str, Any]] = {}
604
604
 
605
- endpoints = devices_state["data"]["listEndpoints"]
605
+ if error := devices_state.get("errors"):
606
+ if isinstance(error, list):
607
+ error = error[0]
608
+ msg = error.get("message", "Unknown error")
609
+ path = error.get("path", "Unknown path")
610
+ _LOGGER.error("Error retrieving devices state: %s for path %s", msg, path)
611
+ return {}, {}
612
+
613
+ if not (data := devices_state.get("data")) or not data.get("listEndpoints"):
614
+ _LOGGER.error("Malformed devices state data received: %s", devices_state)
615
+ return {}, {}
616
+
617
+ endpoints = data["listEndpoints"]
606
618
  for endpoint in endpoints.get("endpoints"):
607
619
  serial_number = (
608
620
  endpoint["serialNumber"]["value"]["text"]