-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement option to download diagnostics (#1218)
- Loading branch information
1 parent
7dea68d
commit 2c737a9
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from homeassistant.core import HomeAssistant | ||
from homeassistant.config_entries import ConfigEntry | ||
|
||
|
||
async def async_get_config_entry_diagnostics( | ||
hass: HomeAssistant, entry: ConfigEntry | ||
) -> dict: | ||
"""Return diagnostics for a config entry.""" | ||
return { | ||
"entry": entry.as_dict(), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from homeassistant.core import HomeAssistant | ||
from pytest_homeassistant_custom_component.common import MockConfigEntry | ||
from custom_components.powercalc.diagnostics import async_get_config_entry_diagnostics | ||
|
||
|
||
async def test_diagnostics(hass: HomeAssistant, mock_config_entry: MockConfigEntry) -> None: | ||
diagnostics_data = await async_get_config_entry_diagnostics(hass, mock_config_entry) | ||
assert diagnostics_data == { | ||
"entry": mock_config_entry.as_dict() | ||
} |