Home Assistant Unofficial Reference 2024.12.1
__init__.py
Go to the documentation of this file.
1 """ZHA repairs for common environmental and device problems."""
2 
3 from __future__ import annotations
4 
5 from typing import Any, cast
6 
7 from homeassistant.components.repairs import ConfirmRepairFlow, RepairsFlow
8 from homeassistant.core import HomeAssistant
9 from homeassistant.helpers import issue_registry as ir
10 
11 from ..const import DOMAIN
12 from .network_settings_inconsistent import (
13  ISSUE_INCONSISTENT_NETWORK_SETTINGS,
14  NetworkSettingsInconsistentFlow,
15 )
16 from .wrong_silabs_firmware import ISSUE_WRONG_SILABS_FIRMWARE_INSTALLED
17 
18 
19 def async_delete_blocking_issues(hass: HomeAssistant) -> None:
20  """Delete repair issues that should disappear on a successful startup."""
21  ir.async_delete_issue(hass, DOMAIN, ISSUE_WRONG_SILABS_FIRMWARE_INSTALLED)
22  ir.async_delete_issue(hass, DOMAIN, ISSUE_INCONSISTENT_NETWORK_SETTINGS)
23 
24 
26  hass: HomeAssistant,
27  issue_id: str,
28  data: dict[str, str | int | float | None] | None,
29 ) -> RepairsFlow:
30  """Create flow."""
31  if issue_id == ISSUE_INCONSISTENT_NETWORK_SETTINGS:
32  return NetworkSettingsInconsistentFlow(hass, cast(dict[str, Any], data))
33 
34  return ConfirmRepairFlow()
None async_delete_blocking_issues(HomeAssistant hass)
Definition: __init__.py:19
RepairsFlow async_create_fix_flow(HomeAssistant hass, str issue_id, dict[str, str|int|float|None]|None data)
Definition: __init__.py:29