mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Upgrade holidays to 0.9.7 (#16651)
This commit is contained in:
parent
a1e6e04a5e
commit
5e3e441aa0
@ -15,35 +15,38 @@ from homeassistant.const import CONF_NAME, WEEKDAYS
|
|||||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
REQUIREMENTS = ['holidays==0.9.7']
|
||||||
|
|
||||||
REQUIREMENTS = ['holidays==0.9.6']
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
# List of all countries currently supported by holidays
|
# List of all countries currently supported by holidays
|
||||||
# There seems to be no way to get the list out at runtime
|
# There seems to be no way to get the list out at runtime
|
||||||
ALL_COUNTRIES = ['Argentina', 'AR', 'Australia', 'AU', 'Austria', 'AT',
|
ALL_COUNTRIES = [
|
||||||
'Belgium', 'BE', 'Canada', 'CA', 'Colombia', 'CO', 'Czech',
|
'Argentina', 'AR', 'Australia', 'AU', 'Austria', 'AT', 'Belarus', 'BY'
|
||||||
'CZ', 'Denmark', 'DK', 'England', 'EuropeanCentralBank',
|
'Belgium', 'BE', 'Canada', 'CA', 'Colombia', 'CO', 'Czech', 'CZ',
|
||||||
'ECB', 'TAR', 'Finland', 'FI', 'France', 'FRA', 'Germany',
|
'Denmark', 'DK', 'England', 'EuropeanCentralBank', 'ECB', 'TAR',
|
||||||
'DE', 'Hungary', 'HU', 'India', 'IND', 'Ireland',
|
'Finland', 'FI', 'France', 'FRA', 'Germany', 'DE', 'Hungary', 'HU',
|
||||||
'Isle of Man', 'Italy', 'IT', 'Japan', 'JP', 'Mexico', 'MX',
|
'India', 'IND', 'Ireland', 'Isle of Man', 'Italy', 'IT', 'Japan', 'JP',
|
||||||
'Netherlands', 'NL', 'NewZealand', 'NZ', 'Northern Ireland',
|
'Mexico', 'MX', 'Netherlands', 'NL', 'NewZealand', 'NZ',
|
||||||
'Norway', 'NO', 'Polish', 'PL', 'Portugal', 'PT',
|
'Northern Ireland', 'Norway', 'NO', 'Polish', 'PL', 'Portugal', 'PT',
|
||||||
'PortugalExt', 'PTE', 'Scotland', 'Slovenia', 'SI',
|
'PortugalExt', 'PTE', 'Scotland', 'Slovenia', 'SI', 'Slovakia', 'SK',
|
||||||
'Slovakia', 'SK', 'South Africa', 'ZA', 'Spain', 'ES',
|
'South Africa', 'ZA', 'Spain', 'ES', 'Sweden', 'SE', 'Switzerland', 'CH',
|
||||||
'Sweden', 'SE', 'Switzerland', 'CH', 'UnitedKingdom', 'UK',
|
'UnitedKingdom', 'UK', 'UnitedStates', 'US', 'Wales',
|
||||||
'UnitedStates', 'US', 'Wales']
|
]
|
||||||
|
|
||||||
|
ALLOWED_DAYS = WEEKDAYS + ['holiday']
|
||||||
|
|
||||||
CONF_COUNTRY = 'country'
|
CONF_COUNTRY = 'country'
|
||||||
CONF_PROVINCE = 'province'
|
CONF_PROVINCE = 'province'
|
||||||
CONF_WORKDAYS = 'workdays'
|
CONF_WORKDAYS = 'workdays'
|
||||||
|
CONF_EXCLUDES = 'excludes'
|
||||||
|
CONF_OFFSET = 'days_offset'
|
||||||
|
|
||||||
# By default, Monday - Friday are workdays
|
# By default, Monday - Friday are workdays
|
||||||
DEFAULT_WORKDAYS = ['mon', 'tue', 'wed', 'thu', 'fri']
|
DEFAULT_WORKDAYS = ['mon', 'tue', 'wed', 'thu', 'fri']
|
||||||
CONF_EXCLUDES = 'excludes'
|
|
||||||
# By default, public holidays, Saturdays and Sundays are excluded from workdays
|
# By default, public holidays, Saturdays and Sundays are excluded from workdays
|
||||||
DEFAULT_EXCLUDES = ['sat', 'sun', 'holiday']
|
DEFAULT_EXCLUDES = ['sat', 'sun', 'holiday']
|
||||||
DEFAULT_NAME = 'Workday Sensor'
|
DEFAULT_NAME = 'Workday Sensor'
|
||||||
ALLOWED_DAYS = WEEKDAYS + ['holiday']
|
|
||||||
CONF_OFFSET = 'days_offset'
|
|
||||||
DEFAULT_OFFSET = 0
|
DEFAULT_OFFSET = 0
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
@ -86,7 +89,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||||||
else:
|
else:
|
||||||
_LOGGER.error("There is no province/state %s in country %s",
|
_LOGGER.error("There is no province/state %s in country %s",
|
||||||
province, country)
|
province, country)
|
||||||
return False
|
return
|
||||||
|
|
||||||
_LOGGER.debug("Found the following holidays for your configuration:")
|
_LOGGER.debug("Found the following holidays for your configuration:")
|
||||||
for date, name in sorted(obj_holidays.items()):
|
for date, name in sorted(obj_holidays.items()):
|
||||||
|
@ -448,7 +448,7 @@ hipnotify==1.0.8
|
|||||||
hole==0.3.0
|
hole==0.3.0
|
||||||
|
|
||||||
# homeassistant.components.binary_sensor.workday
|
# homeassistant.components.binary_sensor.workday
|
||||||
holidays==0.9.6
|
holidays==0.9.7
|
||||||
|
|
||||||
# homeassistant.components.frontend
|
# homeassistant.components.frontend
|
||||||
home-assistant-frontend==20180912.0
|
home-assistant-frontend==20180912.0
|
||||||
|
@ -81,7 +81,7 @@ haversine==0.4.5
|
|||||||
hbmqtt==0.9.4
|
hbmqtt==0.9.4
|
||||||
|
|
||||||
# homeassistant.components.binary_sensor.workday
|
# homeassistant.components.binary_sensor.workday
|
||||||
holidays==0.9.6
|
holidays==0.9.7
|
||||||
|
|
||||||
# homeassistant.components.frontend
|
# homeassistant.components.frontend
|
||||||
home-assistant-frontend==20180912.0
|
home-assistant-frontend==20180912.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user