|
1 | 1 | """Config flow for Technische Alternative C.M.I. integration."""
|
2 | 2 | from __future__ import annotations
|
3 | 3 |
|
| 4 | +import time |
4 | 5 | from copy import deepcopy
|
5 | 6 | from datetime import timedelta
|
6 |
| -import time |
7 | 7 | from typing import Any
|
8 | 8 |
|
| 9 | +import homeassistant.helpers.config_validation as cv |
| 10 | +import voluptuous as vol |
9 | 11 | from aiohttp import ClientSession
|
10 | 12 | from homeassistant import config_entries
|
11 | 13 | from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
12 | 14 | from homeassistant.core import callback
|
13 | 15 | from homeassistant.data_entry_flow import FlowResult
|
14 | 16 | from homeassistant.exceptions import HomeAssistantError
|
15 | 17 | from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
16 |
| -import homeassistant.helpers.config_validation as cv |
17 | 18 | from ta_cmi import CMI, ApiError, Device, InvalidCredentialsError, RateLimitError
|
18 |
| -import voluptuous as vol |
19 | 19 |
|
20 | 20 | from . import custom_sleep
|
21 | 21 | from .const import (
|
@@ -349,9 +349,15 @@ async def async_step_init(
|
349 | 349 | errors["base"] = "unknown"
|
350 | 350 | else:
|
351 | 351 | self.data[CONF_HOST] = user_input[CONF_HOST]
|
352 |
| - return self.async_create_entry(title="", data=self.data) |
| 352 | + self.hass.config_entries.async_update_entry( |
| 353 | + self.config_entry, data=self.data |
| 354 | + ) |
| 355 | + return self.async_create_entry(title="", data={}) |
353 | 356 | else:
|
354 |
| - return self.async_create_entry(title="", data=self.data) |
| 357 | + self.hass.config_entries.async_update_entry( |
| 358 | + self.config_entry, data=self.data |
| 359 | + ) |
| 360 | + return self.async_create_entry(title="", data={}) |
355 | 361 |
|
356 | 362 | return self.async_show_form(
|
357 | 363 | step_id="init",
|
|
0 commit comments