mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Use new internal_state property in tplink diagnostics (#68497)
This commit is contained in:
parent
0802b64d95
commit
94cd656670
@ -36,11 +36,6 @@ async def async_get_config_entry_diagnostics(
|
||||
) -> dict[str, Any]:
|
||||
"""Return diagnostics for a config entry."""
|
||||
coordinator: TPLinkDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
||||
device = coordinator.device
|
||||
|
||||
data = {}
|
||||
data[
|
||||
"device_last_response"
|
||||
] = device._last_update # pylint: disable=protected-access
|
||||
|
||||
return async_redact_data(data, TO_REDACT)
|
||||
return async_redact_data(
|
||||
{"device_last_response": coordinator.device.internal_state}, TO_REDACT
|
||||
)
|
||||
|
@ -38,7 +38,7 @@ async def test_diagnostics(
|
||||
"""Test diagnostics for config entry."""
|
||||
diagnostics_data = json.loads(load_fixture(fixture_file, "tplink"))
|
||||
|
||||
mocked_dev._last_update = diagnostics_data["device_last_response"]
|
||||
mocked_dev.internal_state = diagnostics_data["device_last_response"]
|
||||
|
||||
config_entry = await initialize_config_entry_for_device(hass, mocked_dev)
|
||||
result = await get_diagnostics_for_config_entry(hass, hass_client, config_entry)
|
||||
|
Loading…
x
Reference in New Issue
Block a user