feat: Einstellungen, Neustart, Diagnose-Sensoren und Diagnose-Download

This commit is contained in:
Michael Sauer
2026-09-16 16:08:47 +02:00
parent be0a8e21b6
commit cc318c9d25
13 changed files with 608 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
"""Diagnostics download must not leak secrets or network identity."""
from __future__ import annotations
import json
from homeassistant.core import HomeAssistant
from pytest_homeassistant_custom_component.components.diagnostics import (
get_diagnostics_for_config_entry,
)
from pytest_homeassistant_custom_component.typing import ClientSessionGenerator
from tests_unit.samples import HOST_RGB, MAC_RGB, TOKEN
async def test_diagnostics_redacts_secrets(
hass: HomeAssistant, hass_client: ClientSessionGenerator, init_integration
) -> None:
diagnostics = await get_diagnostics_for_config_entry(hass, hass_client, init_integration)
text = json.dumps(diagnostics)
for secret in (TOKEN, MAC_RGB, "ninIOT", HOST_RGB):
assert secret not in text, secret
assert diagnostics["info"]["device_type"] == "gu10_rgb"
assert diagnostics["state"]["brightness"] == 37