Skip to content

Commit

Permalink
Ensure ReCollect Waste starts up even if no future pickup is found (h…
Browse files Browse the repository at this point in the history
  • Loading branch information
bachya authored Aug 27, 2021
1 parent 46d0523 commit 1f37c21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/recollect_waste/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async def async_step_user(
)

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(
Expand Down
10 changes: 3 additions & 7 deletions tests/components/recollect_waste/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
)
Expand All @@ -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
)
Expand Down

0 comments on commit 1f37c21

Please sign in to comment.