Don't show withings repair if it's not in YAML (#101054)

This commit is contained in:
Joost Lekkerkerker 2023-09-28 19:08:26 +02:00 committed by Franck Nijhof
parent 081f194f6a
commit ad8033c0f2
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -76,29 +76,30 @@ CONFIG_SCHEMA = vol.Schema(
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Withings component.""" """Set up the Withings component."""
async_create_issue( if conf := config.get(DOMAIN):
hass, async_create_issue(
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(
hass, hass,
DOMAIN, HOMEASSISTANT_DOMAIN,
ClientCredential( f"deprecated_yaml_{DOMAIN}",
config[CONF_CLIENT_ID], breaks_in_ha_version="2024.4.0",
config[CONF_CLIENT_SECRET], 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 return True