Compare commits

..

No commits in common. "ebf11021e2c6de166686cf0c703f5cd8655e968f" and "ca599eab7a657ac9994516bc776ec1f77c5664ab" have entirely different histories.

4 changed files with 5 additions and 28 deletions

View File

@ -1 +1 @@
2025.5.1 2025.5.0

View File

@ -4,18 +4,12 @@ from __future__ import annotations
from typing import Any from typing import Any
from lhpapi import HochwasserPortalAPI, LHPError, get_all_stations from lhpapi import HochwasserPortalAPI, LHPError
import voluptuous as vol import voluptuous as vol
from homeassistant.config_entries import ConfigFlow from homeassistant.config_entries import ConfigFlow
from homeassistant.data_entry_flow import FlowResult from homeassistant.data_entry_flow import FlowResult
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.selector import (
SelectOptionDict,
SelectSelector,
SelectSelectorConfig,
SelectSelectorMode,
)
from .const import CONF_ADD_UNAVAILABLE, CONF_PEGEL_IDENTIFIER, DOMAIN, LOGGER from .const import CONF_ADD_UNAVAILABLE, CONF_PEGEL_IDENTIFIER, DOMAIN, LOGGER
@ -56,29 +50,12 @@ class HochwasserPortalConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_create_entry(title=f"{api.name}", data=user_input) return self.async_create_entry(title=f"{api.name}", data=user_input)
stations_dict = await self.hass.async_add_executor_job(get_all_stations)
LOGGER.debug(
"%i stations found on Github",
len(stations_dict),
)
stations = [SelectOptionDict(value="---", label="")]
stations.extend(
SelectOptionDict(value=k, label=f"{v} ({k})")
for k, v in stations_dict.items()
)
return self.async_show_form( return self.async_show_form(
step_id="user", step_id="user",
errors=errors, errors=errors,
data_schema=vol.Schema( data_schema=vol.Schema(
{ {
vol.Required(CONF_PEGEL_IDENTIFIER): SelectSelector( vol.Required(CONF_PEGEL_IDENTIFIER): cv.string,
SelectSelectorConfig(
options=stations,
mode=SelectSelectorMode.DROPDOWN,
sort=True,
custom_value=True,
)
),
vol.Required(CONF_ADD_UNAVAILABLE, default=False): cv.boolean, vol.Required(CONF_ADD_UNAVAILABLE, default=False): cv.boolean,
} }
), ),

View File

@ -9,6 +9,6 @@
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"issue_tracker": "https://github.com/stephan192/hochwasserportal/issues", "issue_tracker": "https://github.com/stephan192/hochwasserportal/issues",
"loggers": ["hochwasserportal"], "loggers": ["hochwasserportal"],
"requirements": ["lhpapi==1.0.4"], "requirements": ["lhpapi==1.0.3"],
"version": "1.0.2" "version": "1.0.1"
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB