diff --git a/homeassistant/components/jewish_calendar/__init__.py b/homeassistant/components/jewish_calendar/__init__.py index 81fe6cb5377..fd238e8d615 100644 --- a/homeassistant/components/jewish_calendar/__init__.py +++ b/homeassistant/components/jewish_calendar/__init__.py @@ -2,6 +2,8 @@ from __future__ import annotations +from functools import partial + from hdate import Location import voluptuous as vol @@ -129,13 +131,16 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b CONF_HAVDALAH_OFFSET_MINUTES, DEFAULT_HAVDALAH_OFFSET_MINUTES ) - location = Location( - name=hass.config.location_name, - diaspora=diaspora, - latitude=config_entry.data.get(CONF_LATITUDE, hass.config.latitude), - longitude=config_entry.data.get(CONF_LONGITUDE, hass.config.longitude), - altitude=config_entry.data.get(CONF_ELEVATION, hass.config.elevation), - timezone=config_entry.data.get(CONF_TIME_ZONE, hass.config.time_zone), + location = await hass.async_add_executor_job( + partial( + Location, + name=hass.config.location_name, + diaspora=diaspora, + latitude=config_entry.data.get(CONF_LATITUDE, hass.config.latitude), + longitude=config_entry.data.get(CONF_LONGITUDE, hass.config.longitude), + altitude=config_entry.data.get(CONF_ELEVATION, hass.config.elevation), + timezone=config_entry.data.get(CONF_TIME_ZONE, hass.config.time_zone), + ) ) hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = {