From c81f909ee31e191cd8ce23840934ad5372774429 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Fri, 5 Jan 2024 19:45:56 +0100 Subject: [PATCH] Use call_soon_threadsafe in mqtt client unsubscribe callback (#107266) --- homeassistant/components/mqtt/client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/mqtt/client.py b/homeassistant/components/mqtt/client.py index e9ef92ddbf8..7d102e3a32f 100644 --- a/homeassistant/components/mqtt/client.py +++ b/homeassistant/components/mqtt/client.py @@ -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