1 """Repairs for Z-Wave JS."""
3 from __future__
import annotations
5 from homeassistant
import data_entry_flow
10 from .const
import DOMAIN
11 from .helpers
import async_get_node_from_device_id
15 """Handler for an issue fixing flow."""
17 def __init__(self, data: dict[str, str]) ->
None:
19 self.description_placeholders: dict[str, str] = {
20 "device_name": data[
"device_name"]
22 self.device_id: str = data[
"device_id"]
25 self, user_input: dict[str, str] |
None =
None
27 """Handle the first step of a fix flow."""
29 menu_options=[
"confirm",
"ignore"],
30 description_placeholders=self.description_placeholders,
34 self, user_input: dict[str, str] |
None =
None
36 """Handle the confirm step of a fix flow."""
41 reason=
"cannot_connect",
42 description_placeholders=self.description_placeholders,
44 self.hass.async_create_task(node.async_refresh_info())
48 self, user_input: dict[str, str] |
None =
None
50 """Handle the ignore step of a fix flow."""
51 ir.async_get(self.hass).async_ignore(
52 DOMAIN, f
"device_config_file_changed.{self.device_id}",
True
55 reason=
"issue_ignored",
56 description_placeholders=self.description_placeholders,
61 hass: HomeAssistant, issue_id: str, data: dict[str, str] |
None
65 if issue_id.split(
".")[0] ==
"device_config_file_changed":
data_entry_flow.FlowResult async_step_confirm(self, dict[str, str]|None user_input=None)
data_entry_flow.FlowResult async_step_ignore(self, dict[str, str]|None user_input=None)
None __init__(self, dict[str, str] data)
data_entry_flow.FlowResult async_step_init(self, dict[str, str]|None user_input=None)
_FlowResultT async_show_menu(self, *str|None step_id=None, Container[str] menu_options, Mapping[str, str]|None description_placeholders=None)
_FlowResultT async_create_entry(self, *str|None title=None, Mapping[str, Any] data, str|None description=None, Mapping[str, str]|None description_placeholders=None)
_FlowResultT async_abort(self, *str reason, Mapping[str, str]|None description_placeholders=None)
ZwaveNode async_get_node_from_device_id(HomeAssistant hass, str device_id, dr.DeviceRegistry|None dev_reg=None)
RepairsFlow async_create_fix_flow(HomeAssistant hass, str issue_id, dict[str, str]|None data)