diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9ea3f1a..8f45221 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,11 +2,6 @@ version: 2 updates: - - package-ecosystem: "pip" - directory: "/custom_components/hyperhdr" - schedule: - interval: "weekly" - - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/custom_components/android_management_api/api.py b/custom_components/android_management_api/api.py index 12e8b78..2ba9688 100644 --- a/custom_components/android_management_api/api.py +++ b/custom_components/android_management_api/api.py @@ -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.""" diff --git a/custom_components/android_management_api/manifest.json b/custom_components/android_management_api/manifest.json index bd4808c..4397516 100644 --- a/custom_components/android_management_api/manifest.json +++ b/custom_components/android_management_api/manifest.json @@ -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" ],