mirror of
https://github.com/home-assistant/core.git
synced 2026-12-06 13:45:55 -04:00
Remove redundant lock and template checks in MQTT (#191804)
This commit is contained in:
@@ -8,7 +8,7 @@ from itertools import chain
|
||||
import logging
|
||||
import re
|
||||
import time
|
||||
from typing import TYPE_CHECKING, Any
|
||||
from typing import Any
|
||||
|
||||
import probatio
|
||||
|
||||
@@ -901,9 +901,6 @@ async def async_start( # noqa: C901
|
||||
msg.payload,
|
||||
)
|
||||
return
|
||||
if TYPE_CHECKING:
|
||||
assert mqtt_data.data_config_flow_lock
|
||||
|
||||
# Lock to prevent initiating many parallel config flows.
|
||||
# Note: The lock is not intended to prevent a race, only for performance
|
||||
async with mqtt_data.data_config_flow_lock:
|
||||
|
||||
@@ -440,7 +440,7 @@ class MqttValueTemplate:
|
||||
values[ATTR_ENTITY_ID] = self._entity.entity_id
|
||||
values[ATTR_NAME] = self._entity.name
|
||||
# Created again when the entity_id is changed in place
|
||||
if self._value_template.hass and (
|
||||
if (
|
||||
not self._template_state
|
||||
or self._template_state.entity_id != self._entity.entity_id
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user