mirror of
https://github.com/home-assistant/core
synced 2024-09-12 15:16:21 +02:00
Use call_soon_threadsafe in mqtt client unsubscribe callback (#107266)
This commit is contained in:
parent
a600a0e023
commit
c81f909ee3
@ -38,7 +38,6 @@ from homeassistant.helpers.dispatcher import dispatcher_send
|
|||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
from homeassistant.loader import bind_hass
|
from homeassistant.loader import bind_hass
|
||||||
from homeassistant.util import dt as dt_util
|
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 homeassistant.util.logging import catch_log_exception
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
@ -217,7 +216,7 @@ def subscribe(
|
|||||||
|
|
||||||
def remove() -> None:
|
def remove() -> None:
|
||||||
"""Remove listener convert."""
|
"""Remove listener convert."""
|
||||||
run_callback_threadsafe(hass.loop, async_remove).result()
|
hass.loop.call_soon_threadsafe(async_remove)
|
||||||
|
|
||||||
return remove
|
return remove
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user