Add diagnostics to Teslemetry (#115195)

* Add diag

* Add diag and tests

* Fix redaction

* Add another energy redact

* Review Feedback

* Update snapshot

* Fixed the wrong integration

* Fix snapshot again

* Update tests/components/teslemetry/test_diagnostics.py

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
This commit is contained in:
Brett Adams 2024-04-13 04:27:38 +10:00 committed by GitHub
parent bea4c52d10
commit b266224ccd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 364 additions and 0 deletions

View file

@ -0,0 +1,23 @@
"""Test the Telemetry Diagnostics."""
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from . import setup_platform
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerator
async def test_diagnostics(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
snapshot: SnapshotAssertion,
) -> None:
"""Test diagnostics."""
entry = await setup_platform(hass)
diag = await get_diagnostics_for_config_entry(hass, hass_client, entry)
assert diag == snapshot