2019-03-25 00:58:20 +00:00
|
|
|
"""Config flow for AWS component."""
|
|
|
|
|
2023-12-27 11:51:24 +00:00
|
|
|
from collections.abc import Mapping
|
|
|
|
from typing import Any
|
|
|
|
|
2024-02-29 19:07:14 +00:00
|
|
|
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
|
2019-03-25 00:58:20 +00:00
|
|
|
|
|
|
|
from .const import DOMAIN
|
|
|
|
|
|
|
|
|
2024-02-29 19:07:14 +00:00
|
|
|
class AWSFlowHandler(ConfigFlow, domain=DOMAIN):
|
2019-03-25 00:58:20 +00:00
|
|
|
"""Handle a config flow."""
|
|
|
|
|
|
|
|
VERSION = 1
|
|
|
|
|
2024-02-29 19:07:14 +00:00
|
|
|
async def async_step_import(
|
|
|
|
self, user_input: Mapping[str, Any]
|
|
|
|
) -> ConfigFlowResult:
|
2019-03-25 00:58:20 +00:00
|
|
|
"""Import a config entry."""
|
|
|
|
if self._async_current_entries():
|
|
|
|
return self.async_abort(reason="single_instance_allowed")
|
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
return self.async_create_entry(title="configuration.yaml", data=user_input)
|