Clean up post-merge review comments (#64842)

* Clean up post-merge diagnostics PRs

* Trigger Build

* Linting
This commit is contained in:
Aaron Bach 2022-01-24 08:46:22 -07:00 committed by GitHub
parent 5622e45980
commit 3a978fc244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 159 additions and 169 deletions

View File

@ -23,14 +23,10 @@ async def async_get_config_entry_diagnostics(
"""Return diagnostics for a config entry."""
coordinators: dict[str, DataUpdateCoordinator] = hass.data[DOMAIN][entry.entry_id]
return {
"data": {
CATEGORY_CDC_REPORT: async_redact_data(
coordinators[CATEGORY_CDC_REPORT].data, TO_REDACT
),
CATEGORY_USER_REPORT: [
async_redact_data(report, TO_REDACT)
for report in coordinators[CATEGORY_USER_REPORT].data
],
return async_redact_data(
{
CATEGORY_CDC_REPORT: coordinators[CATEGORY_CDC_REPORT].data,
CATEGORY_USER_REPORT: coordinators[CATEGORY_USER_REPORT].data,
},
}
TO_REDACT,
)

View File

@ -27,6 +27,4 @@ async def async_get_config_entry_diagnostics(
"""Return diagnostics for a config entry."""
coordinator: DataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
return {
"data": async_redact_data(coordinator.data, TO_REDACT),
}
return async_redact_data(coordinator.data, TO_REDACT)

View File

@ -7,7 +7,6 @@ from tests.components.diagnostics import get_diagnostics_for_config_entry
async def test_entry_diagnostics(hass, config_entry, hass_client, setup_flunearyou):
"""Test config entry diagnostics."""
assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == {
"data": {
"cdc_report": {
"level": "Low",
"level2": "None",
@ -65,5 +64,4 @@ async def test_entry_diagnostics(hass, config_entry, hass_client, setup_fluneary
"icon": "1",
},
],
},
}

View File

@ -7,7 +7,6 @@ from tests.components.diagnostics import get_diagnostics_for_config_entry
async def test_entry_diagnostics(hass, config_entry, hass_client, setup_notion):
"""Test config entry diagnostics."""
assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == {
"data": {
"bridges": {
"12345": {
"id": 12345,
@ -109,5 +108,4 @@ async def test_entry_diagnostics(hass, config_entry, hass_client, setup_notion):
"links": {"sensor": 525993},
}
},
},
}