mirror of
https://github.com/home-assistant/core.git
synced 2025-04-30 04:07:51 +00:00

* Fetch location data and redact in diagnostics * Implement device tracker * Fix failing tests * Update starlink-grpc-core * Update coveragerc * Hardcode GPS source type * Use translations * Move DEVICE_TRACKERS a little higher in the file * Separate status and location check try/catches * Revert "Separate status and location check try/catches" This reverts commit 7628ec62f639845e9a7f5b460b8c66aad1d1dca3.
22 lines
729 B
Python
22 lines
729 B
Python
"""Fetches diagnostic data for Starlink systems."""
|
|
|
|
from dataclasses import asdict
|
|
from typing import Any
|
|
|
|
from homeassistant.components.diagnostics.util import async_redact_data
|
|
from homeassistant.config_entries import ConfigEntry
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .const import DOMAIN
|
|
from .coordinator import StarlinkUpdateCoordinator
|
|
|
|
TO_REDACT = {"id", "latitude", "longitude", "altitude"}
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
hass: HomeAssistant, entry: ConfigEntry
|
|
) -> dict[str, Any]:
|
|
"""Return diagnostics for Starlink config entries."""
|
|
coordinator: StarlinkUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
|
return async_redact_data(asdict(coordinator.data), TO_REDACT)
|