aioamazondevices 6.4.0__py3-none-any.whl → 6.4.1__py3-none-any.whl

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
  """aioamazondevices library."""
2
2
 
3
- __version__ = "6.4.0"
3
+ __version__ = "6.4.1"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
aioamazondevices/api.py CHANGED
@@ -747,7 +747,6 @@ class AmazonEchoApi:
747
747
  devices_endpoints[serial_number] = endpoint
748
748
  self._endpoints[endpoint["endpointId"]] = serial_number
749
749
 
750
- self._last_endpoint_refresh = datetime.now(UTC)
751
750
  return devices_endpoints
752
751
 
753
752
  async def _response_to_json(self, raw_resp: ClientResponse) -> dict[str, Any]:
@@ -926,17 +925,25 @@ class AmazonEchoApi:
926
925
  self,
927
926
  ) -> dict[str, AmazonDevice]:
928
927
  """Get Amazon devices data."""
929
- if not self._final_devices or (
930
- datetime.now(UTC) - self._last_devices_refresh >= timedelta(days=1)
931
- ):
928
+ delta_devices = datetime.now(UTC) - self._last_devices_refresh
929
+ if delta_devices >= timedelta(days=1):
930
+ _LOGGER.debug(
931
+ "Refreshing devices data after %s",
932
+ str(timedelta(minutes=round(delta_devices.total_seconds() / 60))),
933
+ )
932
934
  # Request base device data
933
935
  await self._get_base_devices()
936
+ self._last_devices_refresh = datetime.now(UTC)
934
937
 
935
- if not self._endpoints or (
936
- datetime.now(UTC) - self._last_endpoint_refresh >= timedelta(minutes=30)
937
- ):
938
+ delta_endpoints = datetime.now(UTC) - self._last_endpoint_refresh
939
+ if delta_endpoints >= timedelta(minutes=30):
940
+ _LOGGER.debug(
941
+ "Refreshing endpoint data after %s",
942
+ str(timedelta(minutes=round(delta_endpoints.total_seconds() / 60))),
943
+ )
938
944
  # Set device endpoint data
939
945
  await self._set_device_endpoints_data()
946
+ self._last_endpoint_refresh = datetime.now(UTC)
940
947
 
941
948
  await self._get_sensor_data()
942
949
 
@@ -1028,7 +1035,6 @@ class AmazonEchoApi:
1028
1035
  )
1029
1036
 
1030
1037
  self._final_devices = final_devices_list
1031
- self._last_devices_refresh = datetime.now(UTC)
1032
1038
 
1033
1039
  async def auth_check_status(self) -> bool:
1034
1040
  """Check AUTH status."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aioamazondevices
3
- Version: 6.4.0
3
+ Version: 6.4.1
4
4
  Summary: Python library to control Amazon devices
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -16,8 +16,7 @@ Requires-Dist: aiohttp (>=3.12.7)
16
16
  Requires-Dist: beautifulsoup4
17
17
  Requires-Dist: colorlog
18
18
  Requires-Dist: langcodes
19
- Requires-Dist: orjson
20
- Requires-Dist: yarl
19
+ Requires-Dist: orjson (>=3.10,<4)
21
20
  Project-URL: Bug Tracker, https://github.com/chemelli74/aioamazondevices/issues
22
21
  Project-URL: Changelog, https://github.com/chemelli74/aioamazondevices/blob/main/CHANGELOG.md
23
22
  Project-URL: Homepage, https://github.com/chemelli74/aioamazondevices
@@ -1,12 +1,12 @@
1
- aioamazondevices/__init__.py,sha256=zz9ketTcgCPBPuHWcXvZG6yu5M4IxzEpRNRWvR4ETpc,276
2
- aioamazondevices/api.py,sha256=YX-3khyvvvWdsq3XE2Q1P3AzRtkw-juWoBC_qdnGA3g,49661
1
+ aioamazondevices/__init__.py,sha256=W1DlpFQ7YzCz9wmCqo41TbshbOrFmGh0FlSjOpVXN70,276
2
+ aioamazondevices/api.py,sha256=fwy2bPbcdYqy4_1ZXxU6IYnlZkH_NAVe52ij9yFB6R4,50006
3
3
  aioamazondevices/const.py,sha256=A0aMbjPgIOAsSL20vjhAVkLBsi9QfkvL-1YAOEEa85I,11474
4
4
  aioamazondevices/exceptions.py,sha256=gRYrxNAJnrV6uRuMx5e76VMvtNKyceXd09q84pDBBrI,638
5
5
  aioamazondevices/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  aioamazondevices/query.py,sha256=SKn-fXFUnXnCvmKd6IvAGdkFL7sBzhYBEAZ0aZ2ez9E,1800
7
7
  aioamazondevices/sounds.py,sha256=CXMDk-KoKVFxBdVAw3MeOClqgpzcVDxvQhFOJp7qX-Y,1896
8
8
  aioamazondevices/utils.py,sha256=RzuKRhnq_8ymCoJMoQJ2vBYyuew06RSWpqQWmqdNczE,2019
9
- aioamazondevices-6.4.0.dist-info/METADATA,sha256=xuedY3lpMT_rHFMdPFRh6IgxMiSB_requRjwulwbxRE,7656
10
- aioamazondevices-6.4.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
11
- aioamazondevices-6.4.0.dist-info/licenses/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
12
- aioamazondevices-6.4.0.dist-info/RECORD,,
9
+ aioamazondevices-6.4.1.dist-info/METADATA,sha256=EwLXYMIHymMWkqRnCytEvokAr0E6FyFWb-R_1CbzZdA,7648
10
+ aioamazondevices-6.4.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
11
+ aioamazondevices-6.4.1.dist-info/licenses/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
12
+ aioamazondevices-6.4.1.dist-info/RECORD,,