core/homeassistant/components/wallbox/config_flow.py

96 lines
3.1 KiB
Python
Raw Normal View History

Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
"""Config flow for Wallbox integration."""
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
import voluptuous as vol
from wallbox import Wallbox
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
from homeassistant import config_entries, core
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.data_entry_flow import FlowResult
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
from . import InvalidAuth, WallboxCoordinator
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
from .const import CONF_STATION, DOMAIN
COMPONENT_DOMAIN = DOMAIN
STEP_USER_DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_STATION): str,
vol.Required(CONF_USERNAME): str,
vol.Required(CONF_PASSWORD): str,
}
)
async def validate_input(
hass: core.HomeAssistant, data: dict[str, Any]
) -> dict[str, str]:
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
"""Validate the user input allows to connect.
Data has the keys from STEP_USER_DATA_SCHEMA with values provided by the user.
"""
wallbox = Wallbox(data["username"], data["password"])
wallbox_coordinator = WallboxCoordinator(data["station"], wallbox, hass)
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
await wallbox_coordinator.async_validate_input()
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
# Return info that you want to store in the config entry.
return {"title": "Wallbox Portal"}
class ConfigFlow(config_entries.ConfigFlow, domain=COMPONENT_DOMAIN):
"""Handle a config flow for Wallbox."""
def __init__(self) -> None:
"""Start the Wallbox config flow."""
self._reauth_entry: config_entries.ConfigEntry | None = None
async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult:
"""Perform reauth upon an API authentication error."""
self._reauth_entry = self.hass.config_entries.async_get_entry(
self.context["entry_id"]
)
return await self.async_step_user()
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
"""Handle the initial step."""
if user_input is None:
return self.async_show_form(
step_id="user",
data_schema=STEP_USER_DATA_SCHEMA,
)
errors = {}
try:
await self.async_set_unique_id(user_input["station"])
if not self._reauth_entry:
self._abort_if_unique_id_configured()
info = await validate_input(self.hass, user_input)
return self.async_create_entry(title=info["title"], data=user_input)
if user_input["station"] == self._reauth_entry.data[CONF_STATION]:
self.hass.config_entries.async_update_entry(
self._reauth_entry, data=user_input, unique_id=user_input["station"]
)
self.hass.async_create_task(
self.hass.config_entries.async_reload(self._reauth_entry.entry_id)
)
return self.async_abort(reason="reauth_successful")
errors["base"] = "reauth_invalid"
except ConnectionError:
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
errors["base"] = "cannot_connect"
except InvalidAuth:
errors["base"] = "invalid_auth"
return self.async_show_form(
step_id="user",
data_schema=STEP_USER_DATA_SCHEMA,
errors=errors,
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
)