Home Assistant Unofficial Reference 2024.12.1
repairs.py
Go to the documentation of this file.
1 """Repair implementations."""
2 
3 from homeassistant.core import HomeAssistant
4 from homeassistant.helpers import issue_registry as ir
5 
6 from .const import (
7  CONST_OVERLAY_MANUAL,
8  CONST_OVERLAY_TADO_DEFAULT,
9  DOMAIN,
10  WATER_HEATER_FALLBACK_REPAIR,
11 )
12 
13 
15  hass: HomeAssistant,
16  water_heater_names: list[str],
17  integration_overlay_fallback: str | None,
18 ) -> None:
19  """Notify users about water heater respecting fallback setting."""
20  if integration_overlay_fallback in (
21  CONST_OVERLAY_TADO_DEFAULT,
22  CONST_OVERLAY_MANUAL,
23  ):
24  for water_heater_name in water_heater_names:
25  ir.async_create_issue(
26  hass=hass,
27  domain=DOMAIN,
28  issue_id=f"{WATER_HEATER_FALLBACK_REPAIR}_{water_heater_name}",
29  is_fixable=False,
30  is_persistent=False,
31  severity=ir.IssueSeverity.WARNING,
32  translation_key=WATER_HEATER_FALLBACK_REPAIR,
33  )
None manage_water_heater_fallback_issue(HomeAssistant hass, list[str] water_heater_names, str|None integration_overlay_fallback)
Definition: repairs.py:18