* Add Google Drive integration for backup * Add test_config_flow * Stop using aiogoogle * address a few comments * Check folder exists in setup * fix test * address comments * fix * fix * Use ChunkAsyncStreamIterator in helpers * repair-issues: todo * Remove check if folder exists in the reatuh flow. This is done in setup. * single_config_entry": true * Add test_init.py * Store into backups.json to avoid 124 bytes per property limit * Address comments * autouse=True on setup_credentials * Store metadata in description and remove backups.json * improvements * timeout downloads * library * fixes * strings * review * ruff * fix test * Set unique_id * Use slugify in homeassistant.util * Fix * Remove RefreshError * review * push more fields to the test constant --------- Co-authored-by: Joostlek <joostlek@outlook.com>
22 lines
883 B
Python
22 lines
883 B
Python
"""application_credentials platform for Google Drive."""
|
|
|
|
from homeassistant.components.application_credentials import AuthorizationServer
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
|
|
async def async_get_authorization_server(hass: HomeAssistant) -> AuthorizationServer:
|
|
"""Return authorization server."""
|
|
return AuthorizationServer(
|
|
"https://accounts.google.com/o/oauth2/v2/auth",
|
|
"https://oauth2.googleapis.com/token",
|
|
)
|
|
|
|
|
|
async def async_get_description_placeholders(hass: HomeAssistant) -> dict[str, str]:
|
|
"""Return description placeholders for the credentials dialog."""
|
|
return {
|
|
"oauth_consent_url": "https://console.cloud.google.com/apis/credentials/consent",
|
|
"more_info_url": "https://www.home-assistant.io/integrations/google_drive/",
|
|
"oauth_creds_url": "https://console.cloud.google.com/apis/credentials",
|
|
}
|