Ensure ReCollect Waste starts up even if no future pickup is found (#55349)

This commit is contained in:
Aaron Bach 2021-08-27 16:00:17 -06:00 committed by GitHub
parent 46d0523f98
commit 1f37c215f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -59,7 +59,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
)
try:
await client.async_get_next_pickup_event()
await client.async_get_pickup_events()
except RecollectError as err:
LOGGER.error("Error during setup of integration: %s", err)
return self.async_show_form(

View File

@ -36,7 +36,7 @@ async def test_invalid_place_or_service_id(hass):
conf = {CONF_PLACE_ID: "12345", CONF_SERVICE_ID: "12345"}
with patch(
"aiorecollect.client.Client.async_get_next_pickup_event",
"aiorecollect.client.Client.async_get_pickup_events",
side_effect=RecollectError,
):
result = await hass.config_entries.flow.async_init(
@ -87,9 +87,7 @@ async def test_step_import(hass):
with patch(
"homeassistant.components.recollect_waste.async_setup_entry", return_value=True
), patch(
"aiorecollect.client.Client.async_get_next_pickup_event", return_value=True
):
), patch("aiorecollect.client.Client.async_get_pickup_events", return_value=True):
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_IMPORT}, data=conf
)
@ -105,9 +103,7 @@ async def test_step_user(hass):
with patch(
"homeassistant.components.recollect_waste.async_setup_entry", return_value=True
), patch(
"aiorecollect.client.Client.async_get_next_pickup_event", return_value=True
):
), patch("aiorecollect.client.Client.async_get_pickup_events", return_value=True):
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}, data=conf
)