Clean up Z-Wave config flow (#141595)

This commit is contained in:
Martin Hjelmare 2025-03-27 20:30:16 +01:00 committed by GitHub
parent 1ad12d5945
commit 51db140aed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,19 +21,16 @@ from homeassistant.components.hassio import (
)
from homeassistant.config_entries import (
SOURCE_USB,
ConfigEntriesFlowManager,
ConfigEntry,
ConfigEntryBaseFlow,
ConfigEntryState,
ConfigFlow,
ConfigFlowContext,
ConfigFlowResult,
OptionsFlow,
OptionsFlowManager,
)
from homeassistant.const import CONF_NAME, CONF_URL
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.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.hassio import is_hassio
@ -191,11 +188,6 @@ class BaseZwaveJSFlow(ConfigEntryBaseFlow, ABC):
self.start_task: asyncio.Task | 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(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@ -355,11 +347,6 @@ class ZWaveJSConfigFlow(BaseZwaveJSFlow, ConfigFlow, domain=DOMAIN):
self.use_addon = False
self._usb_discovery = False
@property
def flow_manager(self) -> ConfigEntriesFlowManager:
"""Return the correct flow manager."""
return self.hass.config_entries.flow
@staticmethod
@callback
def async_get_options_flow(
@ -729,11 +716,6 @@ class OptionsFlowHandler(BaseZwaveJSFlow, OptionsFlow):
self.original_addon_config: dict[str, Any] | 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
def _async_update_entry(self, data: dict[str, Any]) -> None:
"""Update the config entry with new data."""