feat: Einstellungen, Neustart, Diagnose-Sensoren und Diagnose-Download
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""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,
|
||||
)
|
||||
Reference in New Issue
Block a user