pyechorobotics 2.0.0__tar.gz → 2.2.0__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.
- {pyechorobotics-2.0.0/src/pyechorobotics.egg-info → pyechorobotics-2.2.0}/PKG-INFO +1 -1
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/pyproject.toml +1 -1
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/src/echoroboticsapi/api.py +3 -2
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/src/echoroboticsapi/models.py +2 -1
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0/src/pyechorobotics.egg-info}/PKG-INFO +1 -1
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/LICENSE.md +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/README.md +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/setup.cfg +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/setup.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/src/echoroboticsapi/__init__.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/src/echoroboticsapi/smart_fetch.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/src/echoroboticsapi/smart_mode.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/src/pyechorobotics.egg-info/SOURCES.txt +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/src/pyechorobotics.egg-info/dependency_links.txt +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/src/pyechorobotics.egg-info/requires.txt +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/src/pyechorobotics.egg-info/top_level.txt +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/test/test_api.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/test/test_smart_fetch.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/test/test_smart_mode.py +0 -0
|
@@ -83,7 +83,7 @@ class Api:
|
|
|
83
83
|
def token_refresh_duration(self):
|
|
84
84
|
return 5 * 60 # 5 minutes
|
|
85
85
|
|
|
86
|
-
async def get_access_token(self) -> str:
|
|
86
|
+
async def get_access_token(self, force_refresh: bool = False) -> str:
|
|
87
87
|
"""Returns a valid access token
|
|
88
88
|
Performs API call to the refresh endpoint if needed.
|
|
89
89
|
"""
|
|
@@ -96,7 +96,7 @@ class Api:
|
|
|
96
96
|
self.auth_info["obtained_timestamp"] + self.token_refresh_duration
|
|
97
97
|
)
|
|
98
98
|
- time.time()
|
|
99
|
-
) <= 0:
|
|
99
|
+
) <= 0 or force_refresh:
|
|
100
100
|
# have to refresh
|
|
101
101
|
url = URL(f"https://myrobot.echorobotics.com/api/authentication/refresh")
|
|
102
102
|
# url = URL(f"http://httpbin.org/cookies")
|
|
@@ -280,6 +280,7 @@ class Api:
|
|
|
280
280
|
url_obj = URL(url)
|
|
281
281
|
|
|
282
282
|
response = await self.request(method="GET", url=url_obj)
|
|
283
|
+
response.raise_for_status()
|
|
283
284
|
json = await response.json()
|
|
284
285
|
try:
|
|
285
286
|
resp = Current.model_validate(json)
|
|
@@ -49,7 +49,8 @@ def dtparse(value) -> datetime.datetime:
|
|
|
49
49
|
ret = dateutil_isoparse(value)
|
|
50
50
|
is_aware = ret.tzinfo is not None and ret.tzinfo.utcoffset(ret) is not None
|
|
51
51
|
if not is_aware:
|
|
52
|
-
|
|
52
|
+
# since 2026 10 28 the API has started reporting non-aware timestamps in what appears to be zulu time
|
|
53
|
+
ret = ret.replace(tzinfo=datetime.timezone.utc)
|
|
53
54
|
return ret
|
|
54
55
|
|
|
55
56
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyechorobotics-2.0.0 → pyechorobotics-2.2.0}/src/pyechorobotics.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|