Skip to content

Commit

Permalink
variable
Browse files Browse the repository at this point in the history
  • Loading branch information
gjohansson-ST committed Sep 28, 2024
1 parent 29ab265 commit 0abeaa1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions homeassistant/components/workday/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ async def async_setup_entry(
)
calc_add_holidays: list[str] = validate_dates(add_holidays)
calc_remove_holidays: list[str] = validate_dates(remove_holidays)
next_year = dt_util.now().year + 1

# Add custom holidays
try:
Expand All @@ -153,8 +154,8 @@ async def async_setup_entry(
except KeyError as unmatched:
LOGGER.warning("No holiday found matching %s", unmatched)
if _date := dt_util.parse_date(remove_holiday):
if _date.year <= dt_util.now().year + 1:
# Only check and raise issues for current year and next year
if _date.year <= next_year:
# Only check and raise issues for current and next year
async_create_issue(
hass,
DOMAIN,
Expand Down

0 comments on commit 0abeaa1

Please sign in to comment.