Skip to content

Commit

Permalink
Allow empty strings for both exclude and include (#159)
Browse files Browse the repository at this point in the history
Fixes #

Description of change:

## Formatting, testing, and code coverage
Please note your pull request won't be accepted if you haven't properly
formatted your source code, and ensured the unit tests are appropriate.
Please note if you are not running on Windows, you can either run the
scripts via a bash installation (like git-bash).

- [X] formatstyle.sh reports no errors
- [X] All unit tests pass (test.sh)
- [X] Code coverage has not decreased (test.sh)
  • Loading branch information
franc6 authored Sep 11, 2024
2 parents ed823bf + d3be311 commit b6c693e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/ics_calendar/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ async def async_step_calendar_opts(
"""Calendar Options step for ConfigFlow."""
errors = {}
if user_input is not None:
if user_input[CONF_EXCLUDE] == user_input[CONF_INCLUDE]:
if (
user_input[CONF_EXCLUDE]
and user_input[CONF_EXCLUDE] == user_input[CONF_INCLUDE]
):
errors[CONF_EXCLUDE] = "exclude_include_cannot_be_the_same"
if user_input[CONF_DOWNLOAD_INTERVAL] < 15:
_LOGGER.error("download_interval_too_small error")
Expand Down

0 comments on commit b6c693e

Please sign in to comment.