mirror of
https://github.com/mx42/home-assistant-ecocito.git
synced 2026-01-14 22:09:49 +01:00
feat: add an option-flow to configure type ID mappings (unused)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user