1
mirror of https://github.com/home-assistant/core synced 2024-08-28 03:36:46 +02:00

Use call_soon_threadsafe in mqtt client unsubscribe callback (#107266)

This commit is contained in:
Jan-Philipp Benecke 2024-01-05 19:45:56 +01:00 committed by GitHub
parent a600a0e023
commit c81f909ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,6 @@ from homeassistant.helpers.dispatcher import dispatcher_send
from homeassistant.helpers.typing import ConfigType
from homeassistant.loader import bind_hass
from homeassistant.util import dt as dt_util
from homeassistant.util.async_ import run_callback_threadsafe
from homeassistant.util.logging import catch_log_exception
from .const import (
@ -217,7 +216,7 @@ def subscribe(
def remove() -> None:
"""Remove listener convert."""
run_callback_threadsafe(hass.loop, async_remove).result()
hass.loop.call_soon_threadsafe(async_remove)
return remove