1 """Repairs for Home Assistant."""
3 from __future__
import annotations
10 from .const
import DOMAIN
14 """Handler for an issue fixing flow."""
16 def __init__(self, data: dict[str, str]) ->
None:
19 self.description_placeholders: dict[str, str] = data
22 self, user_input: dict[str, str] |
None =
None
24 """Handle the first step of a fix flow."""
25 return self.async_show_menu(
27 menu_options=[
"confirm",
"ignore"],
28 description_placeholders=self.description_placeholders,
32 self, user_input: dict[str, str] |
None =
None
34 """Handle the confirm step of a fix flow."""
35 entries = self.hass.config_entries.async_entries(self.
domaindomain)
37 await self.hass.config_entries.async_remove(entry.entry_id)
38 return self.async_create_entry(data={})
41 self, user_input: dict[str, str] |
None =
None
43 """Handle the ignore step of a fix flow."""
44 ir.async_get(self.hass).async_ignore(
45 DOMAIN, f
"integration_not_found.{self.domain}",
True
47 return self.async_abort(
48 reason=
"issue_ignored",
49 description_placeholders=self.description_placeholders,
54 hass: HomeAssistant, issue_id: str, data: dict[str, str] |
None
58 if issue_id.split(
".")[0] ==
"integration_not_found":
61 return ConfirmRepairFlow()
FlowResult async_step_confirm(self, dict[str, str]|None user_input=None)
None __init__(self, dict[str, str] data)
FlowResult async_step_ignore(self, dict[str, str]|None user_input=None)
FlowResult async_step_init(self, dict[str, str]|None user_input=None)
RepairsFlow async_create_fix_flow(HomeAssistant hass, str issue_id, dict[str, str]|None data)