From 0abeaa1a15d95c04674cb5e671e111c37a51a3d7 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Sat, 28 Sep 2024 12:53:17 +0000 Subject: [PATCH] variable --- homeassistant/components/workday/binary_sensor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/workday/binary_sensor.py b/homeassistant/components/workday/binary_sensor.py index 7f31e039b3cc7..f4a2541a1d7e5 100644 --- a/homeassistant/components/workday/binary_sensor.py +++ b/homeassistant/components/workday/binary_sensor.py @@ -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: @@ -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,