Add Number platform to Wallbox (#52786)

Co-authored-by: jan iversen <jancasacondor@gmail.com>
This commit is contained in:
hesselonline 2021-10-27 19:53:14 +02:00 committed by GitHub
parent abb84d9756
commit 6d6cb03848
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 584 additions and 150 deletions

View file

@ -1,10 +1,11 @@
"""Config flow for Wallbox integration."""
import voluptuous as vol
from wallbox import Wallbox
from homeassistant import config_entries, core
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from . import InvalidAuth, WallboxHub
from . import InvalidAuth, WallboxCoordinator
from .const import CONF_STATION, DOMAIN
COMPONENT_DOMAIN = DOMAIN
@ -23,9 +24,10 @@ async def validate_input(hass: core.HomeAssistant, data):
Data has the keys from STEP_USER_DATA_SCHEMA with values provided by the user.
"""
hub = WallboxHub(data["station"], data["username"], data["password"], hass)
wallbox = Wallbox(data["username"], data["password"])
wallbox_coordinator = WallboxCoordinator(data["station"], wallbox, hass)
await hub.async_get_data()
await wallbox_coordinator.async_validate_input()
# Return info that you want to store in the config entry.
return {"title": "Wallbox Portal"}