Avoid expensive inspection of callbacks to setup mqtt subscriptions (#118161)

This commit is contained in:
J. Nick Koston 2024-05-26 01:22:44 -10:00 committed by GitHub
parent 607aaa0efe
commit 5d37217d96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 137 additions and 64 deletions

View file

@ -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(