pyechorobotics 2.0.0__tar.gz → 2.1.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.1.0}/PKG-INFO +1 -1
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/pyproject.toml +1 -1
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/src/echoroboticsapi/api.py +3 -2
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0/src/pyechorobotics.egg-info}/PKG-INFO +1 -1
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/LICENSE.md +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/README.md +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/setup.cfg +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/setup.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/src/echoroboticsapi/__init__.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/src/echoroboticsapi/models.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/src/echoroboticsapi/smart_fetch.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/src/echoroboticsapi/smart_mode.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/src/pyechorobotics.egg-info/SOURCES.txt +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/src/pyechorobotics.egg-info/dependency_links.txt +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/src/pyechorobotics.egg-info/requires.txt +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/src/pyechorobotics.egg-info/top_level.txt +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/test/test_api.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.0}/test/test_smart_fetch.py +0 -0
- {pyechorobotics-2.0.0 → pyechorobotics-2.1.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)
|
|
File without changes
|
|
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.1.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
|