feat(update): Firmware-Update aus dem Ordner mit Einmal-URLs und WLAN-Sicherung
This commit is contained in:
@@ -9,6 +9,7 @@ from homeassistant.const import CONF_HOST, CONF_TOKEN
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .coordinator import NinlightConfigEntry
|
||||
from .shared import DATA_SHARED
|
||||
|
||||
TO_REDACT = {CONF_TOKEN, CONF_HOST, "ssid", "mac", "ip", "sta_ip"}
|
||||
|
||||
@@ -17,11 +18,25 @@ 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,
|
||||
device_type = coordinator.data.info.get("device_type")
|
||||
shared = hass.data.get(DATA_SHARED)
|
||||
images = (
|
||||
[]
|
||||
if shared is None
|
||||
else [
|
||||
{"file": image.path.name, "device_type": image.device_type, "version": image.version}
|
||||
for image in shared.catalog.images
|
||||
if image.device_type == device_type
|
||||
]
|
||||
)
|
||||
return {
|
||||
**async_redact_data(
|
||||
{
|
||||
"entry": {"data": dict(entry.data), "options": dict(entry.options)},
|
||||
"state": coordinator.data.state,
|
||||
"info": coordinator.data.info,
|
||||
},
|
||||
TO_REDACT,
|
||||
),
|
||||
"firmware_images": images,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user