mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Use call_soon_threadsafe in face processing of image_processing (#106168)
This commit is contained in:
parent
e75357980a
commit
88ea5f7a54
@ -24,7 +24,6 @@ from homeassistant.helpers.config_validation import make_entity_service_schema
|
|||||||
from homeassistant.helpers.entity import Entity, EntityDescription
|
from homeassistant.helpers.entity import Entity, EntityDescription
|
||||||
from homeassistant.helpers.entity_component import EntityComponent
|
from homeassistant.helpers.entity_component import EntityComponent
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
from homeassistant.util.async_ import run_callback_threadsafe
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -233,9 +232,7 @@ class ImageProcessingFaceEntity(ImageProcessingEntity):
|
|||||||
|
|
||||||
def process_faces(self, faces: list[FaceInformation], total: int) -> None:
|
def process_faces(self, faces: list[FaceInformation], total: int) -> None:
|
||||||
"""Send event with detected faces and store data."""
|
"""Send event with detected faces and store data."""
|
||||||
run_callback_threadsafe(
|
self.hass.loop.call_soon_threadsafe(self.async_process_faces, faces, total)
|
||||||
self.hass.loop, self.async_process_faces, faces, total
|
|
||||||
).result()
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_process_faces(self, faces: list[FaceInformation], total: int) -> None:
|
def async_process_faces(self, faces: list[FaceInformation], total: int) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user