Avoid expensive inspection of callbacks to setup mqtt subscriptions (#118161)
This commit is contained in:
parent
607aaa0efe
commit
5d37217d96
37 changed files with 137 additions and 64 deletions
|
@ -17,7 +17,7 @@ from homeassistant.components.event import (
|
|||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME, CONF_VALUE_TEMPLATE
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.core import HassJobType, HomeAssistant, callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
@ -200,6 +200,7 @@ class MqttEvent(MqttEntity, EventEntity):
|
|||
"entity_id": self.entity_id,
|
||||
"qos": self._config[CONF_QOS],
|
||||
"encoding": self._config[CONF_ENCODING] or None,
|
||||
"job_type": HassJobType.Callback,
|
||||
}
|
||||
|
||||
self._sub_state = subscription.async_prepare_subscribe_topics(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue