Fix pydantic warnings in purpleair (#133247)

This commit is contained in:
Marc Mueller 2024-12-15 10:34:33 +01:00 committed by GitHub
parent 9494128395
commit af6948a911
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ async def async_get_config_entry_diagnostics(
return async_redact_data(
{
"entry": entry.as_dict(),
"data": coordinator.data.dict(), # type: ignore[deprecated]
"data": coordinator.data.model_dump(),
},
TO_REDACT,
)

View File

@ -73,7 +73,7 @@ def config_entry_options_fixture() -> dict[str, Any]:
@pytest.fixture(name="get_sensors_response", scope="package")
def get_sensors_response_fixture() -> GetSensorsResponse:
"""Define a fixture to mock an aiopurpleair GetSensorsResponse object."""
return GetSensorsResponse.parse_raw(
return GetSensorsResponse.model_validate_json(
load_fixture("get_sensors_response.json", "purpleair")
)