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

pull/101386/head
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
1 changed files with 22 additions and 21 deletions

View File

@ -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