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 diagnostics option #36

Merged
merged 1 commit into from
Nov 13, 2022
Merged
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion .github/ISSUE_TEMPLATE/issue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,16 @@ body:
id: logs
attributes:
label: Home Assistant log
description: Paste your full log here.
description: Paste your full log here, [how to enable logs](../blob/main/README.md#collect-logs).
render: shell

- type: textarea
id: diagnostics
attributes:
label: Diagnostics
description: Paste your diagnostics content here, [how to get diagnostics](https://www.home-assistant.io/integrations/diagnostics/).
render: json

- type: textarea
id: additional-information
attributes:
Expand Down
18 changes: 18 additions & 0 deletions custom_components/kamstrup_403/diagnostics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Diagnostics support for kamstrup_403."""

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant

from . import DOMAIN, KamstrupUpdateCoordinator


async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry
) -> dict:
"""Return diagnostics for a config entry."""
coordinator: KamstrupUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]

return {
"config_entry": config_entry.as_dict(),
"data": coordinator.data,
}