1
0
mirror of https://github.com/home-assistant/core.git synced 2025-05-02 13:17:53 +00:00
Sid 0d66d298ec
Enable Ruff RET504 ()
* Enable Ruff RET504

* fix test

* Use noqa instead of cast

* fix sonos RET504

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-06 11:07:37 +02:00

30 lines
855 B
Python

"""Diagnostics support for Tractive."""
from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core import HomeAssistant
from .const import DOMAIN, TRACKABLES
TO_REDACT = {CONF_PASSWORD, CONF_EMAIL, "title", "_id"}
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
trackables = hass.data[DOMAIN][config_entry.entry_id][TRACKABLES]
return async_redact_data(
{
"config_entry": config_entry.as_dict(),
"trackables": [item.trackable for item in trackables],
},
TO_REDACT,
)