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

1"""Diagnostics, with the settings of an entry and the reviews it's following""" 

2 

3from __future__ import annotations 

4 

5from typing import TYPE_CHECKING, Any 

6 

7from homeassistant.components.diagnostics import async_redact_data 

8 

9from .const import CONF_CUSTOM_TARGET, CONF_TARGET, CONF_TARGETS 

10 

11if TYPE_CHECKING: 

12 from homeassistant.config_entries import ConfigEntry 

13 from homeassistant.core import HomeAssistant 

14 

15# who is told is nobody else's business 

16REDACT = {CONF_TARGET, CONF_CUSTOM_TARGET, CONF_TARGETS} 

17 

18 

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 }