From 0bebf14e45f377ce315991c3b256106dc46914ce Mon Sep 17 00:00:00 2001 From: Vaclav <44951610+bruxy70@users.noreply.github.com> Date: Thu, 17 Feb 2022 20:59:50 +0100 Subject: [PATCH] Bump holidays to 0.13 (#66612) --- homeassistant/components/workday/binary_sensor.py | 15 ++++++--------- homeassistant/components/workday/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/workday/binary_sensor.py b/homeassistant/components/workday/binary_sensor.py index c6ac7aceae1..3119a7b667b 100644 --- a/homeassistant/components/workday/binary_sensor.py +++ b/homeassistant/components/workday/binary_sensor.py @@ -96,16 +96,13 @@ def setup_platform( obj_holidays = getattr(holidays, country)(years=year) if province: - # 'state' and 'prov' are not interchangeable, so need to make - # sure we use the right one - if hasattr(obj_holidays, "PROVINCES") and province in obj_holidays.PROVINCES: - obj_holidays = getattr(holidays, country)(prov=province, years=year) - elif hasattr(obj_holidays, "STATES") and province in obj_holidays.STATES: - obj_holidays = getattr(holidays, country)(state=province, years=year) + if ( + hasattr(obj_holidays, "subdivisions") + and province in obj_holidays.subdivisions + ): + obj_holidays = getattr(holidays, country)(subdiv=province, years=year) else: - _LOGGER.error( - "There is no province/state %s in country %s", province, country - ) + _LOGGER.error("There is no subdivision %s in country %s", province, country) return # Add custom holidays diff --git a/homeassistant/components/workday/manifest.json b/homeassistant/components/workday/manifest.json index cdf9fa5567b..ca95065e1a9 100644 --- a/homeassistant/components/workday/manifest.json +++ b/homeassistant/components/workday/manifest.json @@ -2,7 +2,7 @@ "domain": "workday", "name": "Workday", "documentation": "https://www.home-assistant.io/integrations/workday", - "requirements": ["holidays==0.12"], + "requirements": ["holidays==0.13"], "codeowners": ["@fabaff"], "quality_scale": "internal", "iot_class": "local_polling", diff --git a/requirements_all.txt b/requirements_all.txt index 38629f5e8bd..7fdf253ccc0 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -830,7 +830,7 @@ hlk-sw16==0.0.9 hole==0.7.0 # homeassistant.components.workday -holidays==0.12 +holidays==0.13 # homeassistant.components.frontend home-assistant-frontend==20220214.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 4b082aa6009..d32f2192f5e 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -543,7 +543,7 @@ hlk-sw16==0.0.9 hole==0.7.0 # homeassistant.components.workday -holidays==0.12 +holidays==0.13 # homeassistant.components.frontend home-assistant-frontend==20220214.0