aioamazondevices 6.4.0__py3-none-any.whl → 6.4.2__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.
- aioamazondevices/__init__.py +1 -1
- aioamazondevices/api.py +16 -9
- {aioamazondevices-6.4.0.dist-info → aioamazondevices-6.4.2.dist-info}/METADATA +2 -3
- {aioamazondevices-6.4.0.dist-info → aioamazondevices-6.4.2.dist-info}/RECORD +6 -6
- {aioamazondevices-6.4.0.dist-info → aioamazondevices-6.4.2.dist-info}/WHEEL +0 -0
- {aioamazondevices-6.4.0.dist-info → aioamazondevices-6.4.2.dist-info}/licenses/LICENSE +0 -0
aioamazondevices/__init__.py
CHANGED
aioamazondevices/api.py
CHANGED
|
@@ -667,7 +667,8 @@ class AmazonEchoApi:
|
|
|
667
667
|
value: str | int | float = "n/a"
|
|
668
668
|
scale: str | None = None
|
|
669
669
|
|
|
670
|
-
|
|
670
|
+
# "error" can be None, missing, or a dict
|
|
671
|
+
api_error = feature_property.get("error") or {}
|
|
671
672
|
error = bool(api_error)
|
|
672
673
|
error_type = api_error.get("type")
|
|
673
674
|
error_msg = api_error.get("message")
|
|
@@ -747,7 +748,6 @@ class AmazonEchoApi:
|
|
|
747
748
|
devices_endpoints[serial_number] = endpoint
|
|
748
749
|
self._endpoints[endpoint["endpointId"]] = serial_number
|
|
749
750
|
|
|
750
|
-
self._last_endpoint_refresh = datetime.now(UTC)
|
|
751
751
|
return devices_endpoints
|
|
752
752
|
|
|
753
753
|
async def _response_to_json(self, raw_resp: ClientResponse) -> dict[str, Any]:
|
|
@@ -926,17 +926,25 @@ class AmazonEchoApi:
|
|
|
926
926
|
self,
|
|
927
927
|
) -> dict[str, AmazonDevice]:
|
|
928
928
|
"""Get Amazon devices data."""
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
929
|
+
delta_devices = datetime.now(UTC) - self._last_devices_refresh
|
|
930
|
+
if delta_devices >= timedelta(days=1):
|
|
931
|
+
_LOGGER.debug(
|
|
932
|
+
"Refreshing devices data after %s",
|
|
933
|
+
str(timedelta(minutes=round(delta_devices.total_seconds() / 60))),
|
|
934
|
+
)
|
|
932
935
|
# Request base device data
|
|
933
936
|
await self._get_base_devices()
|
|
937
|
+
self._last_devices_refresh = datetime.now(UTC)
|
|
934
938
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
939
|
+
delta_endpoints = datetime.now(UTC) - self._last_endpoint_refresh
|
|
940
|
+
if delta_endpoints >= timedelta(minutes=30):
|
|
941
|
+
_LOGGER.debug(
|
|
942
|
+
"Refreshing endpoint data after %s",
|
|
943
|
+
str(timedelta(minutes=round(delta_endpoints.total_seconds() / 60))),
|
|
944
|
+
)
|
|
938
945
|
# Set device endpoint data
|
|
939
946
|
await self._set_device_endpoints_data()
|
|
947
|
+
self._last_endpoint_refresh = datetime.now(UTC)
|
|
940
948
|
|
|
941
949
|
await self._get_sensor_data()
|
|
942
950
|
|
|
@@ -1028,7 +1036,6 @@ class AmazonEchoApi:
|
|
|
1028
1036
|
)
|
|
1029
1037
|
|
|
1030
1038
|
self._final_devices = final_devices_list
|
|
1031
|
-
self._last_devices_refresh = datetime.now(UTC)
|
|
1032
1039
|
|
|
1033
1040
|
async def auth_check_status(self) -> bool:
|
|
1034
1041
|
"""Check AUTH status."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aioamazondevices
|
|
3
|
-
Version: 6.4.
|
|
3
|
+
Version: 6.4.2
|
|
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=
|
|
2
|
-
aioamazondevices/api.py,sha256=
|
|
1
|
+
aioamazondevices/__init__.py,sha256=ECul7evV__nDMl-qpUXehkdk8WYdb0rg9V4iZXaVsWQ,276
|
|
2
|
+
aioamazondevices/api.py,sha256=n4UGA0WErnLBehpus3avG8jU1A2lIqlJYyK_AJt0l5E,50066
|
|
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.
|
|
10
|
-
aioamazondevices-6.4.
|
|
11
|
-
aioamazondevices-6.4.
|
|
12
|
-
aioamazondevices-6.4.
|
|
9
|
+
aioamazondevices-6.4.2.dist-info/METADATA,sha256=jQOLDdNi3yIWctP3SaFdKxnozkwALCBffJYI7uqEq0c,7648
|
|
10
|
+
aioamazondevices-6.4.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
11
|
+
aioamazondevices-6.4.2.dist-info/licenses/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
|
|
12
|
+
aioamazondevices-6.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|