aioamazondevices 6.4.5__tar.gz → 6.4.6__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.
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/PKG-INFO +1 -1
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/pyproject.toml +1 -1
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/src/aioamazondevices/__init__.py +1 -1
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/src/aioamazondevices/api.py +7 -1
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/LICENSE +0 -0
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/README.md +0 -0
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/src/aioamazondevices/const.py +0 -0
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/src/aioamazondevices/exceptions.py +0 -0
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/src/aioamazondevices/py.typed +0 -0
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/src/aioamazondevices/query.py +0 -0
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/src/aioamazondevices/sounds.py +0 -0
- {aioamazondevices-6.4.5 → aioamazondevices-6.4.6}/src/aioamazondevices/utils.py +0 -0
|
@@ -943,8 +943,13 @@ class AmazonEchoApi:
|
|
|
943
943
|
await self._get_base_devices()
|
|
944
944
|
self._last_devices_refresh = datetime.now(UTC)
|
|
945
945
|
|
|
946
|
+
# Only refresh endpoint data if we have no endpoints yet
|
|
946
947
|
delta_endpoints = datetime.now(UTC) - self._last_endpoint_refresh
|
|
947
|
-
|
|
948
|
+
endpoint_refresh_needed = delta_endpoints >= timedelta(days=1)
|
|
949
|
+
endpoints_recently_checked = delta_endpoints < timedelta(minutes=30)
|
|
950
|
+
if (
|
|
951
|
+
not self._endpoints and not endpoints_recently_checked
|
|
952
|
+
) or endpoint_refresh_needed:
|
|
948
953
|
_LOGGER.debug(
|
|
949
954
|
"Refreshing endpoint data after %s",
|
|
950
955
|
str(timedelta(minutes=round(delta_endpoints.total_seconds() / 60))),
|
|
@@ -972,6 +977,7 @@ class AmazonEchoApi:
|
|
|
972
977
|
device.sensors["dnd"] = device_dnd
|
|
973
978
|
|
|
974
979
|
async def _set_device_endpoints_data(self) -> None:
|
|
980
|
+
"""Set device endpoint data."""
|
|
975
981
|
devices_endpoints = await self._get_devices_endpoint_data()
|
|
976
982
|
for serial_number in self._final_devices:
|
|
977
983
|
device_endpoint = devices_endpoints.get(serial_number, {})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|