Don't show withings repair if it's not in YAML (#101054)
parent
081f194f6a
commit
ad8033c0f2
|
@ -76,29 +76,30 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Set up the Withings component."""
|
||||
|
||||
async_create_issue(
|
||||
hass,
|
||||
HOMEASSISTANT_DOMAIN,
|
||||
f"deprecated_yaml_{DOMAIN}",
|
||||
breaks_in_ha_version="2024.4.0",
|
||||
is_fixable=False,
|
||||
issue_domain=DOMAIN,
|
||||
severity=IssueSeverity.WARNING,
|
||||
translation_key="deprecated_yaml",
|
||||
translation_placeholders={
|
||||
"domain": DOMAIN,
|
||||
"integration_title": "Withings",
|
||||
},
|
||||
)
|
||||
if CONF_CLIENT_ID in config:
|
||||
await async_import_client_credential(
|
||||
if conf := config.get(DOMAIN):
|
||||
async_create_issue(
|
||||
hass,
|
||||
DOMAIN,
|
||||
ClientCredential(
|
||||
config[CONF_CLIENT_ID],
|
||||
config[CONF_CLIENT_SECRET],
|
||||
),
|
||||
HOMEASSISTANT_DOMAIN,
|
||||
f"deprecated_yaml_{DOMAIN}",
|
||||
breaks_in_ha_version="2024.4.0",
|
||||
is_fixable=False,
|
||||
issue_domain=DOMAIN,
|
||||
severity=IssueSeverity.WARNING,
|
||||
translation_key="deprecated_yaml",
|
||||
translation_placeholders={
|
||||
"domain": DOMAIN,
|
||||
"integration_title": "Withings",
|
||||
},
|
||||
)
|
||||
if CONF_CLIENT_ID in conf:
|
||||
await async_import_client_credential(
|
||||
hass,
|
||||
DOMAIN,
|
||||
ClientCredential(
|
||||
conf[CONF_CLIENT_ID],
|
||||
conf[CONF_CLIENT_SECRET],
|
||||
),
|
||||
)
|
||||
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in New Issue