From 87dfe826137d191ff69e648a0d283ac258c4e8e3 Mon Sep 17 00:00:00 2001 From: Tom Brien Date: Wed, 28 Sep 2022 09:39:43 +0100 Subject: [PATCH] Bump holidays to 0.16 (#78832) --- homeassistant/components/workday/binary_sensor.py | 10 ++++++---- homeassistant/components/workday/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/workday/binary_sensor.py b/homeassistant/components/workday/binary_sensor.py index 44fb0f871de..e66efa039a1 100644 --- a/homeassistant/components/workday/binary_sensor.py +++ b/homeassistant/components/workday/binary_sensor.py @@ -6,7 +6,7 @@ import logging from typing import Any import holidays -from holidays import HolidayBase +from holidays import DateLike, HolidayBase import voluptuous as vol from homeassistant.components.binary_sensor import ( @@ -87,7 +87,7 @@ def setup_platform( discovery_info: DiscoveryInfoType | None = None, ) -> None: """Set up the Workday sensor.""" - add_holidays: list[str] = config[CONF_ADD_HOLIDAYS] + add_holidays: list[DateLike] = config[CONF_ADD_HOLIDAYS] remove_holidays: list[str] = config[CONF_REMOVE_HOLIDAYS] country: str = config[CONF_COUNTRY] days_offset: int = config[CONF_OFFSET] @@ -138,8 +138,10 @@ def setup_platform( _LOGGER.debug("No holidays to remove or invalid holidays") _LOGGER.debug("Found the following holidays for your configuration:") - for remove_holiday, name in sorted(obj_holidays.items()): - _LOGGER.debug("%s %s", remove_holiday, name) + for holiday_date, name in sorted(obj_holidays.items()): + # Make explicit str variable to avoid "Incompatible types in assignment" + _holiday_string = holiday_date.strftime("%Y-%m-%d") + _LOGGER.debug("%s %s", _holiday_string, name) add_entities( [IsWorkdaySensor(obj_holidays, workdays, excludes, days_offset, sensor_name)], diff --git a/homeassistant/components/workday/manifest.json b/homeassistant/components/workday/manifest.json index 186ae56bbdc..97dc2c37501 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.14.2"], + "requirements": ["holidays==0.16"], "codeowners": ["@fabaff"], "quality_scale": "internal", "iot_class": "local_polling", diff --git a/requirements_all.txt b/requirements_all.txt index 5447f46af8a..f5890d7eaa4 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -859,7 +859,7 @@ hlk-sw16==0.0.9 hole==0.7.0 # homeassistant.components.workday -holidays==0.14.2 +holidays==0.16 # homeassistant.components.frontend home-assistant-frontend==20220907.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index bd565cda02c..a5c2510839d 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -639,7 +639,7 @@ hlk-sw16==0.0.9 hole==0.7.0 # homeassistant.components.workday -holidays==0.14.2 +holidays==0.16 # homeassistant.components.frontend home-assistant-frontend==20220907.2