* 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 7628ec62f6
.
21 lines
729 B
Python
21 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)
|