Fix US states check (fixes #7015) (#7017)

This commit is contained in:
Fabian Affolter 2017-04-10 16:13:43 +02:00 committed by Pascal Vizeli
parent 6cd3758b58
commit ab247b0f4d

View file

@ -66,8 +66,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
obj_holidays = getattr(holidays, country)(years=year)
if province:
if province not in obj_holidays.PROVINCES:
_LOGGER.error('There is no province/state %s in country %s',
if province not in obj_holidays.PROVINCES and \
province not in obj_holidays.STATES:
_LOGGER.error("There is no province/state %s in country %s",
province, country)
return False
else: