mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Add links to enable Google Calendar API (#142377)
* Add links to enable Google Calendar API * Update tests
This commit is contained in:
parent
a93121a88d
commit
1d845623a8
@ -197,7 +197,12 @@ class OAuth2FlowHandler(
|
||||
"Error reading primary calendar, make sure Google Calendar API is enabled: %s",
|
||||
err,
|
||||
)
|
||||
return self.async_abort(reason="api_disabled")
|
||||
return self.async_abort(
|
||||
reason="calendar_api_disabled",
|
||||
description_placeholders={
|
||||
"calendar_api_url": "https://console.cloud.google.com/apis/library/calendar-json.googleapis.com"
|
||||
},
|
||||
)
|
||||
except ApiException as err:
|
||||
_LOGGER.error("Error reading primary calendar: %s", err)
|
||||
return self.async_abort(reason="cannot_connect")
|
||||
|
@ -28,7 +28,7 @@
|
||||
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
|
||||
"timeout_connect": "[%key:common::config_flow::error::timeout_connect%]",
|
||||
"code_expired": "Authentication code expired or credential setup is invalid, please try again.",
|
||||
"api_disabled": "You must enable the Google Calendar API in the Google Cloud Console"
|
||||
"calendar_api_disabled": "You must [enable the Google Calendar API]({calendar_api_url}) in the Google Cloud Console"
|
||||
},
|
||||
"create_entry": {
|
||||
"default": "[%key:common::config_flow::create_entry::authenticated%]"
|
||||
|
@ -570,7 +570,7 @@ async def test_reauth_flow(
|
||||
("primary_calendar_error", "primary_calendar_status", "reason"),
|
||||
[
|
||||
(ClientError(), None, "cannot_connect"),
|
||||
(None, HTTPStatus.FORBIDDEN, "api_disabled"),
|
||||
(None, HTTPStatus.FORBIDDEN, "calendar_api_disabled"),
|
||||
(None, HTTPStatus.SERVICE_UNAVAILABLE, "cannot_connect"),
|
||||
],
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user