Use HA location name as name in GIOS integration (#52585)

This commit is contained in:
Maciej Bieniek 2021-07-06 17:52:22 +02:00 committed by GitHub
parent 3d7fd83ad4
commit 62c3b3bdfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,14 +14,7 @@ from homeassistant.const import CONF_NAME
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import API_TIMEOUT, CONF_STATION_ID, DEFAULT_NAME, DOMAIN
DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_STATION_ID): int,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): str,
}
)
from .const import API_TIMEOUT, CONF_STATION_ID, DOMAIN
class GiosFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@ -60,5 +53,14 @@ class GiosFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
errors[CONF_STATION_ID] = "invalid_sensors_data"
return self.async_show_form(
step_id="user", data_schema=DATA_SCHEMA, errors=errors
step_id="user",
data_schema=vol.Schema(
{
vol.Required(CONF_STATION_ID): int,
vol.Optional(
CONF_NAME, default=self.hass.config.location_name
): str,
}
),
errors=errors,
)