mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Refactor deprecated workday argument (#111379)
This commit is contained in:
parent
a94f8bd14d
commit
49ae81c5c4
@ -38,7 +38,7 @@ def _validate_country_and_province(
|
|||||||
if not province:
|
if not province:
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
country_holidays(country, prov=province)
|
country_holidays(country, subdiv=province)
|
||||||
except NotImplementedError as ex:
|
except NotImplementedError as ex:
|
||||||
async_create_issue(
|
async_create_issue(
|
||||||
hass,
|
hass,
|
||||||
@ -68,7 +68,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
_validate_country_and_province(hass, entry, country, province)
|
_validate_country_and_province(hass, entry, country, province)
|
||||||
|
|
||||||
if country and CONF_LANGUAGE not in entry.options:
|
if country and CONF_LANGUAGE not in entry.options:
|
||||||
cls: HolidayBase = country_holidays(country, prov=province)
|
cls: HolidayBase = country_holidays(country, subdiv=province)
|
||||||
default_language = cls.default_language
|
default_language = cls.default_language
|
||||||
new_options = entry.options.copy()
|
new_options = entry.options.copy()
|
||||||
new_options[CONF_LANGUAGE] = default_language
|
new_options[CONF_LANGUAGE] = default_language
|
||||||
|
Loading…
x
Reference in New Issue
Block a user