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) obj_holidays = getattr(holidays, country)(years=year)
if province: if province:
if province not in obj_holidays.PROVINCES: if province not in obj_holidays.PROVINCES and \
_LOGGER.error('There is no province/state %s in country %s', province not in obj_holidays.STATES:
_LOGGER.error("There is no province/state %s in country %s",
province, country) province, country)
return False return False
else: else: