Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change User-Agent to pymyq #54

Merged
merged 2 commits into from Dec 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pymyq/api.py
Expand Up @@ -17,7 +17,7 @@
API_BASE = "https://api.myqdevice.com/api/v{0}"

DEFAULT_APP_ID = "JVM/G9Nwih5BwKgNCjLxiFUQxQijAebyyg8QUHr7JOrP+tuPb8iHfRHKwTmDzHOu"
DEFAULT_USER_AGENT = "okhttp/3.10.0"
DEFAULT_USER_AGENT = 'pymyq'
DEFAULT_BRAND_ID = 2
DEFAULT_REQUEST_RETRIES = 5
DEFAULT_CULTURE = "en"
Expand Down Expand Up @@ -92,6 +92,7 @@ async def _send_request(
return data
except ClientError as err:
_LOGGER.debug(f"Attempt {attempt} request failed with exception: {str(err)}")
message = f"Error requesting data from {url}: {data.get('description', str(err))}"
if hasattr(err, "status") and err.status == 401:
if login_request:
self._credentials = {}
Expand All @@ -111,7 +112,6 @@ async def _send_request(
attempt = 0
continue

message = f"Error requesting data from {url}: {data.get('description', str(err))}"
_LOGGER.error(message)
raise RequestError(message)

Expand Down