#InfluxDB repair

1 messages · Page 1 of 1 (latest)

mental merlin
#

sup!

#

There are a ton of examples in the code, anything specifically you're struggling with?

#

Or at least a ton, we've done it a ton, so most of it is in history 😂

sonic timber
#

You said I should be more specific with my error... but that means creating 5 custom error strings just for that. Is that what you want? Or is it ok to just put an error code (e.g. 'invalid_auth') via a translation placeholder in there?

mental merlin
#

we should create separate error messages

#

we see the same in proxmox

#
  "issues": {
    "deprecated_yaml_import_issue_cannot_connect": {
      "description": "Configuring {integration_title} via YAML is deprecated and will be removed in a future release. While importing your configuration, a connection error occurred. Please correct your YAML configuration and restart Home Assistant, or remove the {domain} key from your configuration and configure the integration via the UI.",
      "title": "[%key:component::proxmoxve::issues::deprecated_yaml_import_issue_connect_timeout::title%]"
    },
    "deprecated_yaml_import_issue_connect_timeout": {
      "description": "Configuring {integration_title} via YAML is deprecated and will be removed in a future release. While importing your configuration, a connection timeout occurred. Please correct your YAML configuration and restart Home Assistant, or remove the {domain} key from your configuration and configure the integration via the UI.",
      "title": "The {integration_title} YAML configuration is being removed"
    },
#

I'd recommend checking proxmox, It's generally more convenient to just check the result of the flow creation, than to do it in both places

sonic timber
#

dang, ok

#

Ok, and another thing. I would love to throw my repair issue in the import flow, but because the integration is "single_config_entry": true
this would only run once (when the entry is created). Thus the yaml issue would dissapear afterwards. Is it ok to raise it in async_setup?

mental merlin
#

Oh yea that is fine

#

I generally recommend to do it outside of the config fglow

#
async def _async_setup(hass: HomeAssistant, config: ConfigType) -> None:
    for entry_config in config[DOMAIN]:
        result = await hass.config_entries.flow.async_init(
            DOMAIN,
            context={"source": SOURCE_IMPORT},
            data=entry_config,
        )
        if (
            result.get("type") is FlowResultType.ABORT
            and result.get("reason") != "already_configured"
        ):
            ir.async_create_issue(
                hass,
                DOMAIN,
                f"deprecated_yaml_import_issue_{result.get('reason')}",
                breaks_in_ha_version="2026.8.0",
                is_fixable=False,
                issue_domain=DOMAIN,
                severity=ir.IssueSeverity.WARNING,
                translation_key=f"deprecated_yaml_import_issue_{result.get('reason')}",
                translation_placeholders={
                    "domain": DOMAIN,
                    "integration_title": "Proxmox VE",
                },
            )
            return

        ir.async_create_issue(
            hass,
            HOMEASSISTANT_DOMAIN,