mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00

* Migrate data to habiticalib * Add habiticalib to init and coordinator * Migrate Habitica config flow to habiticalib * migrate init to habiticalib * migrate buttons to habiticalib * migrate switch to habiticalib * update habiticalib * cast_skill action * migrate update_score * migrate transformation items action * migrate quest actions * fix fixture errors * Migrate coordinator data and content * bump habiticalib * Remove habitipy and use wrapper in habiticalub * changes * some fixes * minor refactoring * class_needed annotation * Update diagnostics * do integration setup in coordinator setup * small changes * raise HomeAssistantError for TooManyRequestsError * fix docstring * update tests * changes to tests/snapshots * fix update_todo_item
28 lines
766 B
Python
28 lines
766 B
Python
"""Diagnostics platform for Habitica integration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from homeassistant.const import CONF_URL
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .const import CONF_API_USER
|
|
from .types import HabiticaConfigEntry
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
hass: HomeAssistant, config_entry: HabiticaConfigEntry
|
|
) -> dict[str, Any]:
|
|
"""Return diagnostics for a config entry."""
|
|
|
|
habitica_data = await config_entry.runtime_data.habitica.get_user_anonymized()
|
|
|
|
return {
|
|
"config_entry_data": {
|
|
CONF_URL: config_entry.data[CONF_URL],
|
|
CONF_API_USER: config_entry.data[CONF_API_USER],
|
|
},
|
|
"habitica_data": habitica_data.to_dict()["data"],
|
|
}
|