aioamazondevices 3.2.9__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.9
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.9"
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.9"
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():