aioamazondevices 3.2.8__tar.gz → 3.2.10__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.2.8
3
+ Version: 3.2.10
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
  [project]
2
2
  name = "aioamazondevices"
3
- version = "3.2.8"
3
+ version = "3.2.10"
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__ = "3.2.8"
3
+ __version__ = "3.2.10"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
@@ -150,6 +150,7 @@ class AmazonEchoApi:
150
150
 
151
151
  self.session: ClientSession
152
152
  self._devices: dict[str, Any] = {}
153
+ self._sensors_available: bool = True
153
154
 
154
155
  if locale and (lang := locale.get("language")):
155
156
  language = lang
@@ -614,6 +615,7 @@ class AmazonEchoApi:
614
615
  URI_IDS,
615
616
  await self._http_phrase_error(raw_resp.status),
616
617
  )
618
+ self._sensors_available = False
617
619
  return []
618
620
 
619
621
  json_data = await raw_resp.json()
@@ -840,10 +842,12 @@ class AmazonEchoApi:
840
842
  else:
841
843
  self._devices[dev_serial] = {key: data}
842
844
 
843
- entity_ids_list = await self._get_devices_ids()
844
- devices_sensors = (
845
- await self._get_sensors_states(entity_ids_list) if entity_ids_list else {}
846
- )
845
+ devices_sensors: dict[str, dict[str, AmazonDeviceSensor]] = {}
846
+
847
+ if self._sensors_available and (
848
+ entity_ids_list := await self._get_devices_ids()
849
+ ):
850
+ devices_sensors = await self._get_sensors_states(entity_ids_list)
847
851
 
848
852
  final_devices_list: dict[str, AmazonDevice] = {}
849
853
  for device in self._devices.values():
@@ -1017,6 +1021,8 @@ class AmazonEchoApi:
1017
1021
  "skillId": "amzn1.ask.1p.tellalexa",
1018
1022
  "text": message_body,
1019
1023
  }
1024
+ else:
1025
+ raise ValueError(f"Message type <{message_type}> is not recognised")
1020
1026
 
1021
1027
  sequence = {
1022
1028
  "@type": "com.amazon.alexa.behaviors.model.Sequence",
@@ -317,7 +317,7 @@ DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
317
317
  "hw_version": None,
318
318
  },
319
319
  "A4ZP7ZC4PI6TO": {
320
- "model": "Echo Show 3",
320
+ "model": "Echo Show 5",
321
321
  "hw_version": "Gen1",
322
322
  },
323
323
  "A4ZXE0RM7LQ7A": {