Skip to content

Commit d11668b

Browse files
authored
Remove useless string split from mqtt diagnostics (#166035)
1 parent ed3f70b commit d11668b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

homeassistant/components/mqtt/diagnostics.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
CONF_PASSWORD,
1414
CONF_USERNAME,
1515
)
16-
from homeassistant.core import HomeAssistant, callback, split_entity_id
16+
from homeassistant.core import HomeAssistant, callback
1717
from homeassistant.helpers import device_registry as dr, entity_registry as er
1818
from homeassistant.helpers.device_registry import DeviceEntry
1919

@@ -103,10 +103,8 @@ def _state_dict(entity_entry: er.RegistryEntry) -> dict[str, Any] | None:
103103
# The context doesn't provide useful information in this case.
104104
state_dict.pop("context", None)
105105

106-
entity_domain = split_entity_id(state.entity_id)[0]
107-
108106
# Retract some sensitive state attributes
109-
if entity_domain == device_tracker.DOMAIN:
107+
if state.domain == device_tracker.DOMAIN:
110108
state_dict["attributes"] = async_redact_data(
111109
state_dict["attributes"], REDACT_STATE_DEVICE_TRACKER
112110
)

0 commit comments

Comments
 (0)