Coverage for custom_components/camera_autonotify/diagnostics.py: 100%
8 statements
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-22 21:32 +0000
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-22 21:32 +0000
1"""Diagnostics, with the settings of an entry and the reviews it's following"""
3from __future__ import annotations
5from typing import TYPE_CHECKING, Any
7from homeassistant.components.diagnostics import async_redact_data
9from .const import CONF_CUSTOM_TARGET, CONF_TARGET, CONF_TARGETS
11if TYPE_CHECKING:
12 from homeassistant.config_entries import ConfigEntry
13 from homeassistant.core import HomeAssistant
15# who is told is nobody else's business
16REDACT = {CONF_TARGET, CONF_CUSTOM_TARGET, CONF_TARGETS}
19async def async_get_config_entry_diagnostics(hass: HomeAssistant, entry: ConfigEntry) -> dict[str, Any]:
20 watcher = getattr(entry, "runtime_data", None)
21 return {
22 "data": dict(entry.data),
23 "options": async_redact_data(dict(entry.options), REDACT),
24 "reviews": watcher.reviews if watcher is not None else [],
25 }