mirror of
https://github.com/home-assistant/core.git
synced 2025-04-27 02:37:50 +00:00
Clean up Z-Wave config flow (#141595)
This commit is contained in:
parent
1ad12d5945
commit
51db140aed
@ -21,19 +21,16 @@ from homeassistant.components.hassio import (
|
|||||||
)
|
)
|
||||||
from homeassistant.config_entries import (
|
from homeassistant.config_entries import (
|
||||||
SOURCE_USB,
|
SOURCE_USB,
|
||||||
ConfigEntriesFlowManager,
|
|
||||||
ConfigEntry,
|
ConfigEntry,
|
||||||
ConfigEntryBaseFlow,
|
ConfigEntryBaseFlow,
|
||||||
ConfigEntryState,
|
ConfigEntryState,
|
||||||
ConfigFlow,
|
ConfigFlow,
|
||||||
ConfigFlowContext,
|
|
||||||
ConfigFlowResult,
|
ConfigFlowResult,
|
||||||
OptionsFlow,
|
OptionsFlow,
|
||||||
OptionsFlowManager,
|
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_NAME, CONF_URL
|
from homeassistant.const import CONF_NAME, CONF_URL
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.data_entry_flow import AbortFlow, FlowManager
|
from homeassistant.data_entry_flow import AbortFlow
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
from homeassistant.helpers.hassio import is_hassio
|
from homeassistant.helpers.hassio import is_hassio
|
||||||
@ -191,11 +188,6 @@ class BaseZwaveJSFlow(ConfigEntryBaseFlow, ABC):
|
|||||||
self.start_task: asyncio.Task | None = None
|
self.start_task: asyncio.Task | None = None
|
||||||
self.version_info: VersionInfo | None = None
|
self.version_info: VersionInfo | None = None
|
||||||
|
|
||||||
@property
|
|
||||||
@abstractmethod
|
|
||||||
def flow_manager(self) -> FlowManager[ConfigFlowContext, ConfigFlowResult]:
|
|
||||||
"""Return the flow manager of the flow."""
|
|
||||||
|
|
||||||
async def async_step_install_addon(
|
async def async_step_install_addon(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
@ -355,11 +347,6 @@ class ZWaveJSConfigFlow(BaseZwaveJSFlow, ConfigFlow, domain=DOMAIN):
|
|||||||
self.use_addon = False
|
self.use_addon = False
|
||||||
self._usb_discovery = False
|
self._usb_discovery = False
|
||||||
|
|
||||||
@property
|
|
||||||
def flow_manager(self) -> ConfigEntriesFlowManager:
|
|
||||||
"""Return the correct flow manager."""
|
|
||||||
return self.hass.config_entries.flow
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(
|
def async_get_options_flow(
|
||||||
@ -729,11 +716,6 @@ class OptionsFlowHandler(BaseZwaveJSFlow, OptionsFlow):
|
|||||||
self.original_addon_config: dict[str, Any] | None = None
|
self.original_addon_config: dict[str, Any] | None = None
|
||||||
self.revert_reason: str | None = None
|
self.revert_reason: str | None = None
|
||||||
|
|
||||||
@property
|
|
||||||
def flow_manager(self) -> OptionsFlowManager:
|
|
||||||
"""Return the correct flow manager."""
|
|
||||||
return self.hass.config_entries.options
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _async_update_entry(self, data: dict[str, Any]) -> None:
|
def _async_update_entry(self, data: dict[str, Any]) -> None:
|
||||||
"""Update the config entry with new data."""
|
"""Update the config entry with new data."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user