mirror of
https://github.com/home-assistant/core.git
synced 2025-07-03 03:17:05 +00:00

* refactor: Utilize custom StarlinkConfigEntry * fix: ruff-format * fix: Init tests * fix: StarlinkConfigEntry in coordinator after recent PRs * fix: CONF_IP_ADDRESS constant * fix: After merge clean up * fix: Naming conventions * feat: Add runtime_data into init test * refactor: Remove runtime_data assert in unload entry test
19 lines
589 B
Python
19 lines
589 B
Python
"""Fetches diagnostic data for Starlink systems."""
|
|
|
|
from dataclasses import asdict
|
|
from typing import Any
|
|
|
|
from homeassistant.components.diagnostics import async_redact_data
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .coordinator import StarlinkConfigEntry
|
|
|
|
TO_REDACT = {"id", "latitude", "longitude", "altitude"}
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
hass: HomeAssistant, config_entry: StarlinkConfigEntry
|
|
) -> dict[str, Any]:
|
|
"""Return diagnostics for Starlink config entries."""
|
|
return async_redact_data(asdict(config_entry.runtime_data.data), TO_REDACT)
|