Add issue when integration key YAML not supported (#93807)

* Add issue when integration key YAML not supported

* Fix feedback

* Fix review

* Update homeassistant/components/homeassistant/strings.json

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
G Johansson 2023-05-31 09:56:33 +02:00 committed by GitHub
parent 661aedde90
commit 3f3b833034
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -11,6 +11,10 @@
"python_version": {
"title": "Support for Python {current_python_version} is being removed",
"description": "Support for running Home Assistant in the current used Python version {current_python_version} is deprecated and will be removed in Home Assistant {breaks_in_ha_version}. Please upgrade Python to {required_python_version} to prevent your Home Assistant instance from breaking."
},
"integration_key_no_support": {
"title": "This integration does not support YAML configuration",
"description": "The {domain} integration does not support configuration via YAML file. You may not notice any obvious issues with the integration, but the configuration settings defined in YAML are not actually applied. \n\nTo resolve this: 1. Please remove this integration from your YAML configuration file.\n\n2. Restart Home Assistant."
}
},
"system_health": {

View file

@ -18,8 +18,9 @@ from .const import (
PLATFORM_FORMAT,
Platform,
)
from .core import CALLBACK_TYPE
from .core import CALLBACK_TYPE, DOMAIN as HOMEASSISTANT_DOMAIN
from .exceptions import DependencyError, HomeAssistantError
from .helpers.issue_registry import IssueSeverity, async_create_issue
from .helpers.typing import ConfigType
from .util import dt as dt_util, ensure_unique_string
@ -235,6 +236,16 @@ async def _async_setup_component(
),
domain,
)
async_create_issue(
hass,
HOMEASSISTANT_DOMAIN,
f"integration_key_no_support_{domain}",
is_fixable=False,
severity=IssueSeverity.ERROR,
issue_domain=domain,
translation_key="integration_key_no_support",
translation_placeholders={"domain": domain},
)
start = timer()
_LOGGER.info("Setting up %s", domain)