Skip to content

Commit

Permalink
feat: add diagnostics (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelli74 authored Sep 6, 2024
1 parent fe19f07 commit 56b6cde
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions custom_components/midea_ac_lan/diagnostics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Diagnostics support for Midea AC LAN."""

from __future__ import annotations

from typing import TYPE_CHECKING, Any

from homeassistant.components.diagnostics import async_redact_data
from homeassistant.const import (
CONF_TOKEN,
)

if TYPE_CHECKING:
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant

from .const import CONF_KEY

TO_REDACT = {CONF_TOKEN, CONF_KEY}


async def async_get_config_entry_diagnostics(
hass: HomeAssistant, # noqa: ARG001
entry: ConfigEntry,
) -> dict[str, Any]:
"""Return diagnostics for a config entry.
Returns
-------
Dictionary of config
"""
return {"entry": async_redact_data(entry.as_dict(), TO_REDACT)}

0 comments on commit 56b6cde

Please sign in to comment.