mirror of
https://github.com/home-assistant/core.git
synced 2026-04-02 08:26:41 +01:00
Remove useless string split from mqtt diagnostics (#166035)
This commit is contained in:
@@ -13,7 +13,7 @@ from homeassistant.const import (
|
||||
CONF_PASSWORD,
|
||||
CONF_USERNAME,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback, split_entity_id
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||
from homeassistant.helpers.device_registry import DeviceEntry
|
||||
|
||||
@@ -103,10 +103,8 @@ def _async_device_as_dict(hass: HomeAssistant, device: DeviceEntry) -> dict[str,
|
||||
# The context doesn't provide useful information in this case.
|
||||
state_dict.pop("context", None)
|
||||
|
||||
entity_domain = split_entity_id(state.entity_id)[0]
|
||||
|
||||
# Retract some sensitive state attributes
|
||||
if entity_domain == device_tracker.DOMAIN:
|
||||
if state.domain == device_tracker.DOMAIN:
|
||||
state_dict["attributes"] = async_redact_data(
|
||||
state_dict["attributes"], REDACT_STATE_DEVICE_TRACKER
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user