mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Add repair issues for nest app auth removal and yaml deprecation (#75974)
* Add repair issues for nest app auth removal and yaml deprecation * Apply PR feedback * Re-apply suggestion that i force pushed over * Update criticality level
This commit is contained in:
parent
81e3ef03f7
commit
26e2ef8175
@ -29,6 +29,11 @@ from homeassistant.components.application_credentials import (
|
|||||||
from homeassistant.components.camera import Image, img_util
|
from homeassistant.components.camera import Image, img_util
|
||||||
from homeassistant.components.http.const import KEY_HASS_USER
|
from homeassistant.components.http.const import KEY_HASS_USER
|
||||||
from homeassistant.components.http.view import HomeAssistantView
|
from homeassistant.components.http.view import HomeAssistantView
|
||||||
|
from homeassistant.components.repairs import (
|
||||||
|
IssueSeverity,
|
||||||
|
async_create_issue,
|
||||||
|
async_delete_issue,
|
||||||
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_BINARY_SENSORS,
|
CONF_BINARY_SENSORS,
|
||||||
@ -187,6 +192,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
entry, unique_id=entry.data[CONF_PROJECT_ID]
|
entry, unique_id=entry.data[CONF_PROJECT_ID]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async_delete_issue(hass, DOMAIN, "removed_app_auth")
|
||||||
|
|
||||||
subscriber = await api.new_subscriber(hass, entry)
|
subscriber = await api.new_subscriber(hass, entry)
|
||||||
if not subscriber:
|
if not subscriber:
|
||||||
return False
|
return False
|
||||||
@ -255,6 +262,18 @@ async def async_import_config(hass: HomeAssistant, entry: ConfigEntry) -> None:
|
|||||||
if entry.data["auth_implementation"] == INSTALLED_AUTH_DOMAIN:
|
if entry.data["auth_implementation"] == INSTALLED_AUTH_DOMAIN:
|
||||||
# App Auth credentials have been deprecated and must be re-created
|
# App Auth credentials have been deprecated and must be re-created
|
||||||
# by the user in the config flow
|
# by the user in the config flow
|
||||||
|
async_create_issue(
|
||||||
|
hass,
|
||||||
|
DOMAIN,
|
||||||
|
"removed_app_auth",
|
||||||
|
is_fixable=False,
|
||||||
|
severity=IssueSeverity.ERROR,
|
||||||
|
translation_key="removed_app_auth",
|
||||||
|
translation_placeholders={
|
||||||
|
"more_info_url": "https://www.home-assistant.io/more-info/nest-auth-deprecation",
|
||||||
|
"documentation_url": "https://www.home-assistant.io/integrations/nest/",
|
||||||
|
},
|
||||||
|
)
|
||||||
raise ConfigEntryAuthFailed(
|
raise ConfigEntryAuthFailed(
|
||||||
"Google has deprecated App Auth credentials, and the integration "
|
"Google has deprecated App Auth credentials, and the integration "
|
||||||
"must be reconfigured in the UI to restore access to Nest Devices."
|
"must be reconfigured in the UI to restore access to Nest Devices."
|
||||||
@ -271,12 +290,14 @@ async def async_import_config(hass: HomeAssistant, entry: ConfigEntry) -> None:
|
|||||||
WEB_AUTH_DOMAIN,
|
WEB_AUTH_DOMAIN,
|
||||||
)
|
)
|
||||||
|
|
||||||
_LOGGER.warning(
|
async_create_issue(
|
||||||
"Configuration of Nest integration in YAML is deprecated and "
|
hass,
|
||||||
"will be removed in a future release; Your existing configuration "
|
DOMAIN,
|
||||||
"(including OAuth Application Credentials) has been imported into "
|
"deprecated_yaml",
|
||||||
"the UI automatically and can be safely removed from your "
|
breaks_in_ha_version="2022.10.0",
|
||||||
"configuration.yaml file"
|
is_fixable=False,
|
||||||
|
severity=IssueSeverity.WARNING,
|
||||||
|
translation_key="deprecated_yaml",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"domain": "nest",
|
"domain": "nest",
|
||||||
"name": "Nest",
|
"name": "Nest",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"dependencies": ["ffmpeg", "http", "application_credentials"],
|
"dependencies": ["ffmpeg", "http", "application_credentials", "repairs"],
|
||||||
"after_dependencies": ["media_source"],
|
"after_dependencies": ["media_source"],
|
||||||
"documentation": "https://www.home-assistant.io/integrations/nest",
|
"documentation": "https://www.home-assistant.io/integrations/nest",
|
||||||
"requirements": ["python-nest==4.2.0", "google-nest-sdm==2.0.0"],
|
"requirements": ["python-nest==4.2.0", "google-nest-sdm==2.0.0"],
|
||||||
|
@ -88,5 +88,15 @@
|
|||||||
"camera_sound": "Sound detected",
|
"camera_sound": "Sound detected",
|
||||||
"doorbell_chime": "Doorbell pressed"
|
"doorbell_chime": "Doorbell pressed"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"issues": {
|
||||||
|
"deprecated_yaml": {
|
||||||
|
"title": "The Nest YAML configuration is being removed",
|
||||||
|
"description": "Configuring Nest in configuration.yaml is being removed in Home Assistant 2022.10.\n\nYour existing OAuth Application Credentials and access settings have been imported into the UI automatically. Remove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue."
|
||||||
|
},
|
||||||
|
"removed_app_auth": {
|
||||||
|
"title": "Nest Authentication Credentials must be updated",
|
||||||
|
"description": "To improve security and reduce phishing risk Google has deprecated the authentication method used by Home Assistant.\n\n**This requires action by you to resolve** ([more info]({more_info_url}))\n\n1. Visit the integrations page\n1. Click Reconfigure on the Nest integration.\n1. Home Assistant will walk you through the steps to upgrade to Web Authentication.\n\nSee the Nest [integration instructions]({documentation_url}) for troubleshooting information."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
"missing_configuration": "The component is not configured. Please follow the documentation.",
|
"missing_configuration": "The component is not configured. Please follow the documentation.",
|
||||||
"no_url_available": "No URL available. For information about this error, [check the help section]({docs_url})",
|
"no_url_available": "No URL available. For information about this error, [check the help section]({docs_url})",
|
||||||
"reauth_successful": "Re-authentication was successful",
|
"reauth_successful": "Re-authentication was successful",
|
||||||
"single_instance_allowed": "Already configured. Only a single configuration possible.",
|
|
||||||
"unknown_authorize_url_generation": "Unknown error generating an authorize URL."
|
"unknown_authorize_url_generation": "Unknown error generating an authorize URL."
|
||||||
},
|
},
|
||||||
"create_entry": {
|
"create_entry": {
|
||||||
@ -26,13 +25,6 @@
|
|||||||
"wrong_project_id": "Please enter a valid Cloud Project ID (was same as Device Access Project ID)"
|
"wrong_project_id": "Please enter a valid Cloud Project ID (was same as Device Access Project ID)"
|
||||||
},
|
},
|
||||||
"step": {
|
"step": {
|
||||||
"auth": {
|
|
||||||
"data": {
|
|
||||||
"code": "Access Token"
|
|
||||||
},
|
|
||||||
"description": "To link your Google account, [authorize your account]({url}).\n\nAfter authorization, copy-paste the provided Auth Token code below.",
|
|
||||||
"title": "Link Google Account"
|
|
||||||
},
|
|
||||||
"auth_upgrade": {
|
"auth_upgrade": {
|
||||||
"description": "App Auth has been deprecated by Google to improve security, and you need to take action by creating new application credentials.\n\nOpen the [documentation]({more_info_url}) to follow along as the next steps will guide you through the steps you need to take to restore access to your Nest devices.",
|
"description": "App Auth has been deprecated by Google to improve security, and you need to take action by creating new application credentials.\n\nOpen the [documentation]({more_info_url}) to follow along as the next steps will guide you through the steps you need to take to restore access to your Nest devices.",
|
||||||
"title": "Nest: App Auth Deprecation"
|
"title": "Nest: App Auth Deprecation"
|
||||||
@ -96,5 +88,15 @@
|
|||||||
"camera_sound": "Sound detected",
|
"camera_sound": "Sound detected",
|
||||||
"doorbell_chime": "Doorbell pressed"
|
"doorbell_chime": "Doorbell pressed"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"issues": {
|
||||||
|
"deprecated_yaml": {
|
||||||
|
"description": "Configuring Nest in configuration.yaml is being removed in Home Assistant 2022.10.\n\nYour existing OAuth Application Credentials and access settings have been imported into the UI automatically. Remove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue.",
|
||||||
|
"title": "The Nest YAML configuration is being removed"
|
||||||
|
},
|
||||||
|
"removed_app_auth": {
|
||||||
|
"description": "To improve security and reduce phishing risk Google has deprecated the authentication method used by Home Assistant.\n\n**This requires action by you to resolve** ([more info]({more_info_url}))\n\n1. Visit the integrations page\n1. Click Reconfigure on the Nest integration.\n1. Home Assistant will walk you through the steps to upgrade to Web Authentication.\n\nSee the Nest [integration instructions]({documentation_url}) for troubleshooting information.",
|
||||||
|
"title": "Nest Authentication Credentials must be updated"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user