Use HA location name as name
in GIOS integration (#52585)
This commit is contained in:
parent
3d7fd83ad4
commit
62c3b3bdfe
1 changed files with 11 additions and 9 deletions
|
@ -14,14 +14,7 @@ from homeassistant.const import CONF_NAME
|
||||||
from homeassistant.data_entry_flow import FlowResult
|
from homeassistant.data_entry_flow import FlowResult
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
|
|
||||||
from .const import API_TIMEOUT, CONF_STATION_ID, DEFAULT_NAME, DOMAIN
|
from .const import API_TIMEOUT, CONF_STATION_ID, DOMAIN
|
||||||
|
|
||||||
DATA_SCHEMA = vol.Schema(
|
|
||||||
{
|
|
||||||
vol.Required(CONF_STATION_ID): int,
|
|
||||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): str,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class GiosFlowHandler(config_entries.ConfigFlow, domain=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"
|
errors[CONF_STATION_ID] = "invalid_sensors_data"
|
||||||
|
|
||||||
return self.async_show_form(
|
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,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue