Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

version: 2
updates:
- package-ecosystem: "pip"
directory: "/custom_components/hyperhdr"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
30 changes: 24 additions & 6 deletions custom_components/android_management_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,30 @@ def _build_service(self):
else:
raise ValueError("No credentials provided")

return build(
"androidmanagement",
"v1",
credentials=creds,
cache_discovery=False,
)
# The library version is pinned to match Home Assistant core, so its bundled
# discovery document can lag the live API (e.g. missing enum values like
# WIPE_ESIMS). Prefer the live document; fall back to the bundled one.
try:
return build(
"androidmanagement",
"v1",
credentials=creds,
cache_discovery=False,
static_discovery=False,
)
except Exception as err: # noqa: BLE001
_LOGGER.warning(
"Could not fetch live Android Management API discovery document, "
"using bundled copy: %s",
err,
)
return build(
"androidmanagement",
"v1",
credentials=creds,
cache_discovery=False,
static_discovery=True,
)

def _execute_request(self, request, max_retries: int = 3):
"""Execute a Google API request with retries for transient SSL/network errors."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/android_management_api/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"android_management_api"
],
"requirements": [
"google-api-python-client==2.198.0",
"google-api-python-client>=2.71.0",
"google-auth==2.56.0",
"qrcode==8.0"
],
Expand Down
Loading