Home Assistant Unofficial Reference 2024.12.1
issues.py
Go to the documentation of this file.
1 """Issues utility for HTML5."""
2 
3 import logging
4 
5 from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant, callback
6 from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
7 
8 from .const import DOMAIN
9 
10 _LOGGER = logging.getLogger(__name__)
11 
12 SUCCESSFUL_IMPORT_TRANSLATION_KEY = "deprecated_yaml"
13 FAILED_IMPORT_TRANSLATION_KEY = "deprecated_yaml_import_issue"
14 
15 INTEGRATION_TITLE = "HTML5 Push Notifications"
16 
17 
18 @callback
19 def async_create_html5_issue(hass: HomeAssistant, import_success: bool) -> None:
20  """Create issues for HTML5."""
21  if import_success:
23  hass,
24  HOMEASSISTANT_DOMAIN,
25  f"deprecated_yaml_{DOMAIN}",
26  breaks_in_ha_version="2025.4.0",
27  is_fixable=False,
28  issue_domain=DOMAIN,
29  severity=IssueSeverity.WARNING,
30  translation_key="deprecated_yaml",
31  translation_placeholders={
32  "domain": DOMAIN,
33  "integration_title": INTEGRATION_TITLE,
34  },
35  )
36  else:
38  hass,
39  DOMAIN,
40  f"deprecated_yaml_{DOMAIN}",
41  breaks_in_ha_version="2025.4.0",
42  is_fixable=False,
43  issue_domain=DOMAIN,
44  severity=IssueSeverity.WARNING,
45  translation_key="deprecated_yaml_import_issue",
46  translation_placeholders={
47  "domain": DOMAIN,
48  "integration_title": INTEGRATION_TITLE,
49  },
50  )
None async_create_html5_issue(HomeAssistant hass, bool import_success)
Definition: issues.py:19
None async_create_issue(HomeAssistant hass, str entry_id)
Definition: repairs.py:69