217 files
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.components.sensor import SensorDeviceClass
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.reload import async_integration_yaml_config
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
from custom_components.powercalc import CONF_SENSOR_TYPE, DOMAIN, SensorType
|
||||
from custom_components.powercalc.const import CONF_SENSOR_TYPE, DOMAIN, SensorType
|
||||
from custom_components.powercalc.sensors.group.config_entry_utils import get_entries_excluding_global_config
|
||||
from custom_components.powercalc.sensors.group.custom import resolve_entity_ids_recursively
|
||||
|
||||
@@ -15,10 +17,10 @@ _LOGGER = logging.getLogger(__name__)
|
||||
async def async_get_config_entry_diagnostics(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
) -> dict:
|
||||
) -> dict[str, Any]:
|
||||
"""Return diagnostics for a config entry."""
|
||||
|
||||
data: dict = {
|
||||
data: dict[str, Any] = {
|
||||
"entry": entry.as_dict(),
|
||||
"config_entry_count_per_type": get_count_by_sensor_type(hass),
|
||||
"yaml_config": await get_yaml_configuration(hass),
|
||||
@@ -42,7 +44,7 @@ def get_count_by_sensor_type(hass: HomeAssistant) -> dict[SensorType, int]:
|
||||
return count_per_type
|
||||
|
||||
|
||||
async def get_yaml_configuration(hass: HomeAssistant) -> dict:
|
||||
async def get_yaml_configuration(hass: HomeAssistant) -> ConfigType:
|
||||
"""Return the YAML configuration for powercalc integration."""
|
||||
try:
|
||||
yaml_config = await async_integration_yaml_config(hass, DOMAIN)
|
||||
|
||||
Reference in New Issue
Block a user