Skip to content

Commit

Permalink
Don't show withings repair if it's not in YAML (home-assistant#101054)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Sep 28, 2023
1 parent 0a540e1 commit f733c43
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions homeassistant/components/withings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,30 @@
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

Expand Down

0 comments on commit f733c43

Please sign in to comment.