Skip to content

Commit

Permalink
stop using async_forward_entry_setup
Browse files Browse the repository at this point in the history
  • Loading branch information
FaserF committed Aug 24, 2024
1 parent 661dc0d commit a04fb96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions custom_components/deutschebahn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ async def async_setup_entry(
hass_data["unsub_options_update_listener"] = unsub_options_update_listener
hass.data[DOMAIN][entry.entry_id] = hass_data

hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "sensor")
)
# Verwende hier async_forward_entry_setups anstelle von async_forward_entry_setup
await hass.config_entries.async_forward_entry_setups(entry, ["sensor"])

async def async_update_data():
"""Fetch data from Schiene."""
Expand Down
4 changes: 2 additions & 2 deletions custom_components/deutschebahn/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __get_option(key: str, default: Any) -> Any:
data_schema=vol.Schema(
{
vol.Required(CONF_OFFSET, default=0): cv.positive_int,
vol.Required(CONF_MAX_CONNECTIONS, default=2): vol.All(vol.Coerce(int), vol.Range(min=1, max=5)),
vol.Required(CONF_MAX_CONNECTIONS, default=2): vol.All(vol.Coerce(int), vol.Range(min=1, max=6)),
vol.Required(CONF_IGNORED_PRODUCTS, default=[]): cv.multi_select(CONF_IGNORED_PRODUCTS_OPTIONS),
vol.Required(CONF_ONLY_DIRECT, default=False): cv.boolean,
vol.Optional(CONF_UPDATE_INTERVAL, 2): cv.positive_int,
Expand Down Expand Up @@ -74,7 +74,7 @@ async def async_step_user(self, user_input=None):
vol.Required(CONF_START): cv.string,
vol.Required(CONF_DESTINATION): cv.string,
vol.Required(CONF_OFFSET, default=0): cv.positive_int,
vol.Required(CONF_MAX_CONNECTIONS, default=2): vol.All(vol.Coerce(int), vol.Range(min=1, max=5)),
vol.Required(CONF_MAX_CONNECTIONS, default=2): vol.All(vol.Coerce(int), vol.Range(min=1, max=6)),
vol.Required(CONF_IGNORED_PRODUCTS, default=[]): cv.multi_select(CONF_IGNORED_PRODUCTS_OPTIONS),
vol.Required(CONF_ONLY_DIRECT, default=False): cv.boolean,
vol.Optional(CONF_UPDATE_INTERVAL, 2): cv.positive_int,
Expand Down

0 comments on commit a04fb96

Please sign in to comment.