Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration diagnostics, enabled the download of the raw data pro… #490

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions custom_components/myenergi/diagnostics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""Diagnostics support for Daikin Diagnostics."""
from __future__ import annotations
from typing import Any

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceEntry

from pymyenergi.client import MyenergiClient
from pymyenergi.connection import Connection

from .const import DOMAIN

async def async_get_config_entry_diagnostics(
hass: HomeAssistant, entry: ConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
data = {}
coordinator = hass.data[DOMAIN][entry.entry_id]
devices = []
# Don't cause a refresh when fetching devices
all_devices = await coordinator.client.get_devices("all", False)
for device in all_devices:
data[device.serial_number] = device.data
return data

Loading