mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Remove unneeded usage of run_callback_threadsafe in entity helper (#106138)
We do not need to create a future here as we do not need to wait for the result as its going to run in the background in a task anyways
This commit is contained in:
parent
24b1e01d71
commit
dfb08e7efd
@ -31,7 +31,6 @@ from homeassistant.core import (
|
|||||||
from homeassistant.exceptions import HomeAssistantError, PlatformNotReady
|
from homeassistant.exceptions import HomeAssistantError, PlatformNotReady
|
||||||
from homeassistant.generated import languages
|
from homeassistant.generated import languages
|
||||||
from homeassistant.setup import async_start_setup
|
from homeassistant.setup import async_start_setup
|
||||||
from homeassistant.util.async_ import run_callback_threadsafe
|
|
||||||
|
|
||||||
from . import (
|
from . import (
|
||||||
config_validation as cv,
|
config_validation as cv,
|
||||||
@ -429,12 +428,11 @@ class EntityPlatform:
|
|||||||
self, new_entities: Iterable[Entity], update_before_add: bool = False
|
self, new_entities: Iterable[Entity], update_before_add: bool = False
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Schedule adding entities for a single platform, synchronously."""
|
"""Schedule adding entities for a single platform, synchronously."""
|
||||||
run_callback_threadsafe(
|
self.hass.loop.call_soon_threadsafe(
|
||||||
self.hass.loop,
|
|
||||||
self._async_schedule_add_entities,
|
self._async_schedule_add_entities,
|
||||||
list(new_entities),
|
list(new_entities),
|
||||||
update_before_add,
|
update_before_add,
|
||||||
).result()
|
)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _async_schedule_add_entities(
|
def _async_schedule_add_entities(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user