feat: add an option-flow to configure type ID mappings (unused)

This commit is contained in:
Xavier Morel
2025-03-24 21:18:54 +01:00
parent 49d40a3a92
commit 787e9738c7
3 changed files with 115 additions and 3 deletions

View File

@@ -6,9 +6,14 @@ import logging
from typing import Any
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.config_entries import (
ConfigEntry,
ConfigFlow,
ConfigFlowResult,
OptionsFlow,
)
from homeassistant.const import CONF_DOMAIN, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
from homeassistant.core import HomeAssistant, callback
from .client import EcocitoClient
from .const import DOMAIN
@@ -24,7 +29,6 @@ STEP_USER_DATA_SCHEMA = vol.Schema(
}
)
async def validate_input(hass: HomeAssistant, data: dict[str, Any]) -> None:
"""Validate the user input allows us to connect."""
client = EcocitoClient(data[CONF_DOMAIN], data[CONF_USERNAME], data[CONF_PASSWORD])
@@ -59,3 +63,12 @@ class EcocitoConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_show_form(
step_id="user", data_schema=STEP_USER_DATA_SCHEMA, errors=errors
)
@staticmethod
@callback
def async_get_options_flow(
config_entry: ConfigEntry
) -> OptionsFlow:
"""Return the options flow."""
from .options_flow import EcocitoOptionsFlowHandler
return EcocitoOptionsFlowHandler(config_entry)