28 lines
791 B
Python
28 lines
791 B
Python
"""Diagnostics download for ninlight lamps."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from homeassistant.components.diagnostics import async_redact_data
|
|
from homeassistant.const import CONF_HOST, CONF_TOKEN
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .coordinator import NinlightConfigEntry
|
|
|
|
TO_REDACT = {CONF_TOKEN, CONF_HOST, "ssid", "mac", "ip", "sta_ip"}
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
hass: HomeAssistant, entry: NinlightConfigEntry
|
|
) -> dict[str, Any]:
|
|
coordinator = entry.runtime_data
|
|
return async_redact_data(
|
|
{
|
|
"entry": {"data": dict(entry.data), "options": dict(entry.options)},
|
|
"state": coordinator.data.state,
|
|
"info": coordinator.data.info,
|
|
},
|
|
TO_REDACT,
|
|
)
|