mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fix blocking call in Jewish Calendar while initializing location (#120265)
This commit is contained in:
parent
436c36e3dd
commit
143e8d09af
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
from hdate import Location
|
from hdate import Location
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
@ -129,7 +131,9 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||||||
CONF_HAVDALAH_OFFSET_MINUTES, DEFAULT_HAVDALAH_OFFSET_MINUTES
|
CONF_HAVDALAH_OFFSET_MINUTES, DEFAULT_HAVDALAH_OFFSET_MINUTES
|
||||||
)
|
)
|
||||||
|
|
||||||
location = Location(
|
location = await hass.async_add_executor_job(
|
||||||
|
partial(
|
||||||
|
Location,
|
||||||
name=hass.config.location_name,
|
name=hass.config.location_name,
|
||||||
diaspora=diaspora,
|
diaspora=diaspora,
|
||||||
latitude=config_entry.data.get(CONF_LATITUDE, hass.config.latitude),
|
latitude=config_entry.data.get(CONF_LATITUDE, hass.config.latitude),
|
||||||
@ -137,6 +141,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||||||
altitude=config_entry.data.get(CONF_ELEVATION, hass.config.elevation),
|
altitude=config_entry.data.get(CONF_ELEVATION, hass.config.elevation),
|
||||||
timezone=config_entry.data.get(CONF_TIME_ZONE, hass.config.time_zone),
|
timezone=config_entry.data.get(CONF_TIME_ZONE, hass.config.time_zone),
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = {
|
hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = {
|
||||||
CONF_LANGUAGE: language,
|
CONF_LANGUAGE: language,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user